Content Providers Tutorial
Content Provider allow us to write or grab data to a user's contact, document or calendar with a few lines of code.
How do two totally different apps read and write from the same data source? This is where content providers come in.
A content provider is a class that sits between an application and it's data source and it's job is to provide easily managed access to the underlying data source.
Why you may need Content Providers
How do two totally different apps read and write from the same data source? This is where content providers come in.
A content provider is a class that sits between an application and it's data source and it's job is to provide easily managed access to the underlying data source.
Why you may need Content Providers
- As an extra level of abstraction - they allow developers to change the underlying data source without needing to change any code that access the content provider. For example with content providers you can swap out SQLite database for any other database and your app would still remain functional.
- Leverage functionality of android classes ex. Loaders and Cursor Adapter.
- Allow many apps to access, use and modify a single data source securely. So that they can use, access and modify your data source. If you didn't use content provider this data will be limited to just your app and when other apps are using content provider to access your data, they are doing it in a managed and secure way this is because content provider is a single class through which all data requests can be made
Comments
Post a Comment