Join us
Content Providers is one of the android application important component that serves the purpose of a relational database to store the data of applications. Content provider in the android system is like a “central repository” in which data of the applications are stored, and it facilitates other applications to securely access and modifies that data based on the requirements.
What is Content Provider?
Content Providers is one of the android application important component that serves the purpose of a relational database to store the data of applications. Content provider in the android system is like a “central repository” in which data of the applications are stored, and it facilitates other applications to securely access and modifies that data based on the requirements. Content Providers support the four basic operations, normally called CRUD-operations.
What is Content URI(Universal Resource Identifier)?
Content URI is the key concept of content provider. To query a content provider, you can specify the query string in the form of URI.
URI: content://authority/data_type/id
Operations of Content Provider are CRUD
How does Content Provider works?
Android applications UI components like Activities/Fragments use an object CursorLoader to send query requests to ContentResolver. The ContentResolver object sends requests like “create, read, update, and delete” to the ContentProvider as a client. After receiving a request, ContentProvider process it and returns the expected result.
Imlementation of Contnent Provider for fetching contact list
UI components of android applications like Activity and Fragments use an object CursorLoader to send query requests to ContentResolver. The ContentResolver object sends requests (like create, read, update, and delete) to the ContentProvider as a client. After receiving a request, ContentProvider process it and returns the desired result
Conclusion:
you have learned all about the two types of URIs for content providers and basic concepts of using it with an example.
Thanks for reading this article. Be sure to click 👏 below to applause this article if you found it helpful. It means a lot to me.
Join other developers and claim your FAUN account now!
Project Lead, Wipro
@myofficework000Influence
Total Hits
Posts
Only registered users can post comments. Please, login or signup.