Why REST services for Android ContentProviders?

Google could provide the JDBC API,
but decided to translate SQLite using the REST service.
What are the benefits?

Why REST services for Android ContentProviders?

+4
source share
2 answers

Because they abstract the extraction of data from the data itself.

While for the sqlite data source the data is on the phone, you can easily implement a content provider that takes its data from the cloud service.

Thus, you can encode the same interface and easily switch to the data search implementation.

+3
source

All About Ressources. ContentProvider contains Ressources (URI) and gives you MIME / Types. You can use only 4 simple Crud methods. This is the same as using a REST service over HTTP. I think very general and simple, elegant.

Thus, your application can use my ContentProvider, not knowing anything about the database, structure, operators - like a REST-Service. JDBC is not so simple.

+1
source

Source: https://habr.com/ru/post/1347244/


All Articles