Hi,
I am trying to develop AccountAuthenticator and SyncService.
I need help to know more about following points
1. If I add any new account, will it bind this account with SyncService which is already in my application itself.
2. When I try to invoke this method: AccountManager.get(context).addAccount(accType,authToken,null,bundle,null, callback,null) , my authenticator is not getting invoked.
callback function is like this:
AccountManagerCallback<Bundle> callback = new AccountManagerCallback<Bundle>() {
public void run(AccountManagerFuture<Bundle> future) {
try {
Bundle bundle = future.getResult();
Log.d("AddAccountActivity", "Account: "
+ bundle.getString(AccountManager.KEY_ACCOUNT_NAME)
+ " has been created.");
return;
} catch (OperationCanceledException e) {
Log.e("", "addAccount was canceled");
} catch (IOException e) {
Log.e("", "addAccount failed: " + e);
} catch (AuthenticatorException e) {
Log.e("", "addAccount failed: " + e);
}
}
};
In Manifest entry is:
<service
android:name=".auth.AuthService"
android:exported="true">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator" />
</service>
Authenticator.xml is:
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
android:accountType="accType"
android:icon="@drawable/icon"
android:smallIcon="@drawable/icon"
android:label="@string/label"
/>
3. ContentResolver.requestSync(null,authority,null); is also not working to invoke my service.
I am using only "test.authority" value all over for sync authority.
Kindly give me some pointer for above.
Thanks a lot in advance !!

