IT. Expert System.

Android Reference

AbstractAccountAuthenticator


android.accounts

Class AbstractAccountAuthenticator



  • public abstract class AbstractAccountAuthenticator
    extends Object
    Abstract base class for creating AccountAuthenticators. In order to be an authenticator one must extend this class, provider implementations for the abstract methods and write a service that returns the result of getIBinder() in the service's Service.onBind(android.content.Intent) when invoked with an intent with action AccountManager.ACTION_AUTHENTICATOR_INTENT. This service must specify the following intent filter and metadata tags in its AndroidManifest.xml file
       <intent-filter>
         <action android:name="android.accounts.AccountAuthenticator" />
       </intent-filter>
       <meta-data android:name="android.accounts.AccountAuthenticator"
                 android:resource="@xml/authenticator" />
     
    The android:resource attribute must point to a resource that looks like:
     <account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
        android:accountType="typeOfAuthenticator"
        android:icon="@drawable/icon"
        android:smallIcon="@drawable/miniIcon"
        android:label="@string/label"
        android:accountPreferences="@xml/account_preferences"
     />
     
    Replace the icons and labels with your own resources. The android:accountType attribute must be a string that uniquely identifies your authenticator and will be the same string that user will use when making calls on the AccountManager and it also corresponds to Account.type for your accounts. One user of the android:icon is the "Account & Sync" settings page and one user of the android:smallIcon is the Contact Application's tab panels.

    The preferences attribute points to a PreferenceScreen xml hierarchy that contains a list of PreferenceScreens that can be invoked to manage the authenticator. An example is:

     <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
        <PreferenceCategory android:title="@string/title_fmt" />
        <PreferenceScreen
             android:key="key1"
             android:title="@string/key1_action"
             android:summary="@string/key1_summary">
             <intent
                 android:action="key1.ACTION"
                 android:targetPackage="key1.package"
                 android:targetClass="key1.class" />
         </PreferenceScreen>
     </PreferenceScreen>
     

    The standard pattern for implementing any of the abstract methods is the following:

    The following descriptions of each of the abstract authenticator methods will not describe the possible asynchronous nature of the request handling and will instead just describe the input parameters and the expected result.

    When writing an activity to satisfy these requests one must pass in the AccountManagerResponse and return the result via that response when the activity finishes (or whenever else the activity author deems it is the correct time to respond). The AccountAuthenticatorActivity handles this, so one may wish to extend that when writing activities to handle these requests.



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 128 / 158851605. Delta: 0.00825 с