Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用自定义内容提供程序有什么优势?为什么这样的内容提供者优于包装 SQL 查询的普通类?
内容提供者可以在其他进程中使用,并且是 Android 上的某些机制(如全局搜索)所必需的。还有一些可用的类可以帮助您处理内容提供者,从而为您节省一些管理内存的麻烦。
其他应用程序将能够访问您的数据。
您可以在内容提供者中包装和抽象大量查询逻辑,并限制访问。
您将能够依靠系统来支持托管查询等操作。