开发者

Why are Android ContentProviders REST services?

Google could have provided a JDBC 开发者_如何学运维API,

but chose to wrap SQLite with a REST service.

What are the benefits ?

Why are Android ContentProviders REST services ?


Since they abstracted away the data retrieval from the data itself.

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

So you can code against the same interface and easily switch your data retrieval implementation.


It's all about Ressources. A ContentProvider holds Ressources (URIs) and gives you MIME/Types of it. You can use with only 4 simple crud Methods. That's the same as using a REST-Service on HTTP. Very generic and simple, elegant I think.

So your App can use my ContentProvider without knowing anything about database, structure, statements - just as a REST-Service. JDBC is not as simple.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜