As a complete application, data storage operations are essential. Therefore, the Android system provides four data storage methods. They are SharePreference, SQLite, Content Provider, and File. In Android, data is basically private and stored in the "data/package name" directory. Therefore, to share data, use Content Provider.
SQLite: SQLite is a lightweight database that supports basic SQL syntax and is a common data storage method. Android provides a class named SQLiteDatabase for this database, which encapsulates APIs for database operations.
For details, see: SQLite Storage
SharedPreference: in addition to the SQLite database, SharedPreference is another common data storage method. In essence, SharedPreference is an xml file, which is often used to store simple parameter settings.
For details, see SharedPreference storage.
File: A File (I/O) storage method. It is often used to store a large amount of data, but the disadvantage is that updating data will be a difficult task.
ContentProvider: a data storage method that can be shared by all applications in the Android system. Because data is usually private among applications, this storage method is rarely used, however, it is an essential storage method. For example, audio, video, image, and address book can be stored in this way. Each Content Provider provides a public URI (encapsulated as a Uri object). If the application needs to share data, the Content Provider needs to define a URI for the data, then other applications pass in the URI through the Content Provider to operate the data.
PS: URI consists of three parts: "content: //", data path, and ID (optional ).
For details, see ContentProvider storage.