问题
What are advantages of using custom content provider? Why such content provider is superior of plain class that wraps SQL queries?
回答1:
Content providers can be used from other processes and are required by some mechanisms on Android like the global search. There are also some classes available that help you deal with content providers that save you some of the hassle of manging memory.
回答2:
Other apps will be able to access your data.
You can wrap and abstract a lot of the query logic in your content provider, and limit access.
You will be able to lean on the system to allow for things like managed queries.
来源:https://stackoverflow.com/questions/4079117/why-should-i-use-custom-content-provider-in-android