Next day
Textutils.isempty (Var) determines whether a certain amount of Var is empty
"Zhangtao". Equals (Var) determines whether Var equals zhangtao
The way to bring up DDMS in Android Studio is to press the small green robot on the toolbar to find the file Explorer
If you write file File = new file ("A.txt") in the program; This is to be created directly under the directory of the application, which is created unsuccessfully. The directory of the application under data/app/, this directory is not allowed to create files.
Each app creates a file for it under the/data/data/package name, which is the folder where the data is stored. For example, file File = new file ("/data/data/com.example.zhangtao/info.txt"); This is the way to be.
Context.getfilesdir (); Help us return the data/data/package name/files directory For example: File File = new file (Context.getfilesdir (), "context.txt");
Context.getcachedir (); Help us return to the data/data/package name/cache directory
Use the context to write files directly, can not context.getfilesdir (); The following code: (will be automatically saved in the data/data/package name/files directory)
FileOutputStream fos = context.openfileoutput ("Private.txt", context.mode_private);
Fos.write ("Aabb". GetBytes ());
Fos.close ();
Dark Horse Android Notes