Step 7, step 4, getting started with Piglet Android
Step 7, step 4, getting started with Piglet Android
Data storage and access for Android-ContentProvider)
--- Reprinted with the source: coder-pig
This section introduces:
In the previous study, we have learned some ways to store data, which can be shared. For example, for files, we can perform operations
The mode is set to Context. MODE_WORLD_READABLE or Context. MODE_WORLD_WRITEABLE. Other applications
You can access the file for read and write operations. SharedPreference can also be used for sharing, and permissions can also be set! And use
The benefit of ContentProvider's data sharing is that the same data access method! This is the only way to share data between different applications, because
For a storage region that does not provide the access of all applications in Android! Well, it's actually not that mysterious. Please follow the author's instructions below.
To parse the ContentProvider of Android!
This section describes the road map:
Body:
ContentProvider overview and execution principles
Custom ContentProvider
Reference code:
Code Effect: Insert a record into the database of the first program through the second program
Download reference code:Code download
Use the ContentProvider provided by the system
Code example: Call the SMS and contacts provided by the system
Download reference code:Code download
Listen for ContentProvider data changes
Download:Code download