Android saves and reads data to files
Android gets fileoutputstream
Context. openfileoutput (file, permission)
Context is the context of the environment, and activity inherits the ccontext class.For exampleAA inherits Activity
You can write it like this.: AA. This. openfileoutput (file, permission)
File: Name and extension of the file created for the user, such as water.txt
Permission: Android has four Permissions
1. Context. mode_private
Private Attribute, accessible only by yourself, and the content written for the second time will overwrite the content written for the first time
2. Context. mode_append
Private Attribute, accessible only by yourself. The content written for the second time will be appended to the end of the content written for the first time.
3. Context. mode_world_writeable
Public attributes can be written to other projects, but the content written for the second time will overwrite the content written for the first time.
4. Context. mode_world_readable
Public attributes, which can be read by other projects
Permissions can be added, for example
Now I want another project to read, write, and append.
Context. mode_world_readable + context. mode_world_writeable + context. mode_append
Files created by Android are stored in/data/package name/files on the mobile phone.
Android gets fileinputstream
Context. openinfileoutput (file)
Context is the context of the environment, and activity inherits the context class.
File: Name and extension of the file created for the user, such as water.txt