Why should I use custom content provider in Android?

拟墨画扇 提交于 2019-12-22 06:47:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!