我试图理解Android同步逻辑,但是我不明白的是Android SDK示例项目SampleSyncAdapter
中包含的syncadapter.xml
文件。如果您已经下载了SDK示例,它应该在以下文件夹中:
SDK/android-sdk-PLATFORM/samples/android-VERSION/SampleSyncAdapter/res/xml/syncadapter.xml
我读到,内容提供者的权限应该是一个字符串或资源的引用。什么是内容权限,com.android.contacts
在哪里?这是文件的内容(没有许可信息和注释,API级别为16)。
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
android:contentAuthority="com.android.contacts"
android:accountType="com.example.android.samplesync"
android:supportsUploading="false"
android:userVisible="true"
/>
android:contentAuthority
设置。 - JJD