Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To understand what the authority is you need to see the <a href="http://developer.android.com/guide/topics/providers/content-providers.html" rel="nofollow noreferrer">documentation of ContentProvider</a>:</p> <p>It states: "it identifies the content provider. For third-party applications, this should be a fully-qualified class name (reduced to lowercase) to ensure uniqueness. The authority is declared in the element's authorities attribute"</p> <p>The account type is an identificator of your Authenticator that will be used for example by the clients of the <em>AccountManager</em> to call <code>getAccountsByType(String)</code>.</p> <p>For the <em>SampleSyncAdapter</em>:</p> <pre><code>android:contentAuthority="com.android.contacts" android:accountType="com.example.android.samplesync" </code></pre> <p>android:accountType is the same as that one defined by the authenticator.</p> <p>So the content-Authority specifies which content provider will be synchronized locally and the accountType specifies which authenticator will be used to access the data remotely. The accountType is also used to obtain the sync adapter's specific content-uri.</p> <p>For example when you want to start a sync you need to call <em>requestSync</em> like this:</p> <pre><code>final Account account = new Account(accountName, ACCOUNT_TYPE); ContentResolver.requestSync(account, CONTENT_AUTHORITY, new Bundle()); </code></pre> <p>At the same time to build the content-uri for your sync adapter you can use something like:</p> <pre><code>Uri CONTENT_URI = ContactsContract.RawContacts.CONTENT_URI.buildUpon().appendQueryParameter(RawContacts.ACCOUNT_NAME, accountName).appendQueryParameter(RawContacts.ACCOUNT_TYPE, SyncAdapter.ACCOUNT_TYPE).build(); </code></pre> <p>Have a look to <a href="https://stackoverflow.com/questions/3994843/android-sync-adapter">android-sync-adapter</a></p> <hr> <p>Meanwhile, the previously mentioned ContentProvider documentation has been revised. The <a href="http://developer.android.com/guide/topics/providers/content-provider-creating.html#ContentURI" rel="nofollow noreferrer">latest version</a> states:</p> <blockquote> <p><strong>Designing an authority</strong></p> <p>A provider usually has a single authority, which serves as its Android-internal name. To avoid conflicts with other providers, you should use Internet domain ownership (in reverse) as the basis of your provider authority. Because this recommendation is also true for Android package names, you can define your provider authority as an extension of the name of the package containing the provider. For example, if your Android package name is <code>com.example.&lt;appname&gt;</code>, you should give your provider the authority <code>com.example.&lt;appname&gt;.provider</code>.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload