To understand what you need, you need to look at the ContentProvider documentation :
It states: "it identifies the content provider. For third-party applications, this must be the fully qualified name of the class (lowercase) to ensure uniqueness. Power is declared in the elementβs authority attribute"
The type of account is the identifier of your Authenticator, which will be used, for example, by AccountManager clients to call getAccountsByType(String) .
For SampleSyncAdapter:
android:contentAuthority="com.android.contacts" android:accountType="com.example.android.samplesync"
android: accountType is the same as the one defined by the authenticator.
Thus, Content-Authority indicates which content provider will be synchronized locally, and the accountType type indicates which authenticator will be used for remote access to data. The accountType type is also used to get the specific contents of the sync-uri adapter.
For example, if you want to start synchronization, you need to call requestSync as follows:
final Account account = new Account(accountName, ACCOUNT_TYPE); ContentResolver.requestSync(account, CONTENT_AUTHORITY, new Bundle());
At the same time, to create content uri for your sync adapter, you can use something like:
Uri CONTENT_URI = ContactsContract.RawContacts.CONTENT_URI.buildUpon().appendQueryParameter(RawContacts.ACCOUNT_NAME, accountName).appendQueryParameter(RawContacts.ACCOUNT_TYPE, SyncAdapter.ACCOUNT_TYPE).build();
Take a look at android-sync-adapter
Meanwhile, the previously mentioned ContentProvider documentation has been revised. The latest version reads:
Authorization Design
A provider usually has a single authority that serves as its Android internal name. To avoid conflicts with other providers, you must use your domainβs Internet ownership right (in reverse order) as the basis for your provider. Since this recommendation is also true for Android Package Names, you can define the authority of your provider as an extension of the name of the package that contains the provider. For example, if your Android package name is com.example.<appname> , you must give your provider the authority com.example.<appname>.provider .