How I suppose to use files in Android
===

I am trying to develop apps for Android and I don't know how to write/read a file in Android phone.

Normally i would do that, but how it would look on Android?


    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.FileReader;
    import java.io.FileWriter;
    
    public class Test {
    
    	public static void main(String[] args) {
    		try {
    			String path = "file.txt";
    			BufferedWriter bw = new BufferedWriter(new FileWriter(path));
    			bw.write("XYZ");
    			bw.close();

    			BufferedReader br = new BufferedReader(new FileReader(path));
    			String line = "", data = "";
    			while ((line = br.readLine()) != null) {
    				data = data + line;
    			}
    			br.close();
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
    }


    