android系统账户管理(AccountManagerService+AccountAuthenticator)

避免多次登录

AccountManagerService

  • 管理Authenticator

AccountAuthenticator(账户认证器)

  • 认证
  • 授权(AuthToken)
<service  android:name=".AccountAuthenticatorService" android:exported="true" >
    <intent-filter>
        <action android:name="android.accounts.AccountAuthenticator" />
    </intent-filter>

    <meta-data  android:name="android.accounts.AccountAuthenticator" android:resource="@xml/authenticator_config" />
</service>
public class AccountAuthenticator extends AbstractAccountAuthenticator {

}
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
    android:accountType="@string/account_type"
    android:icon="@drawable/account_icon"
    android:label="@string/account_name"
    android:smallIcon="@drawable/account_small_icon" />

你可能感兴趣的:(android系统账户管理(AccountManagerService+AccountAuthenticator))