When to use a Content Provider

后端 未结 9 1499
没有蜡笔的小新
没有蜡笔的小新 2020-11-27 10:52

I understand that Content Providers are made to allow publicly sharing data between applications. However, I\'m wondering if anyone has thoughts about making a Content Provi

9条回答
  •  天涯浪人
    2020-11-27 11:28

    In my view point, the content-provider comes with plenty of advantages leave alone just sharing data with other apps. If you need to synchronize with the server using a Sync-Adapter, use google cloud messaging, auto update the UI when the underlying data in the DB changes using Loaders, implement search, use widgets... then the content provider is for you.

    I prefer you follow the guideline on because one day you may need to implement some of the above features attached to the content-provider

    By the way, you can quickly build you database and CP in less than 5 minutes using content provider generator

提交回复
热议问题