大家,我在看android源码。但是我找不到对我有值(value)的东西。实际上,我想知道ContentProvider
是否像AIDL
一样工作。你知道,AIDL
可以实现两个独立应用程序之间的通信。
所以,我只想看看 ContentProvider
在内部是如何工作的。
最佳答案
来自 ContentProvider Source code
Content providers are one of the primary building blocks of Android applications, providing content to applications. They encapsulate data and provide it to applications through the single ContentResolver interface. A content provider is only required if you need to share data between multiple applications. For example, the contacts data is used by multiple applications and must be stored in a content provider. If you don't need to share data amongst multiple applications you can use a database directly via android.database.sqlite.SQLiteDatabase.
根据这个和我发送给您的链接中的信息,ContentProvider 没有使用 AIDL...它使用的是 ContentResolver 接口(interface)。
关于android - ContentProvider 内部是如何工作的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13116994/