My application needs to synchronize some data from server. I added necessary classes (similarly to SampleSyncAdapter) now I can add account via \"Settings/Sync and Accounts\
There is Android AtLeap library which contains helper classes to use Account Authenticator. Have a look at it https://github.com/blandware/android-atleap
A bit late but...
Account account = new Account("Title", "com.package.nom");
String password = "password";
AccountManager accountManager = AccountManager.get(context);
accountManager.addAccountExplicitly(account, password, null);
Don't you have to add to the following code posted by Evan Elliott :
Account account = new Account("Title", "com.package.nom");
String password = "password";
AccountManager accountManager = AccountManager.get(context);
accountManager.addAccountExplicitly(account, password, null);
The following: ?
authenticator.xml
<?xml version="1.0" encoding="utf-8"?>
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
android:accountType="@string/account_type"
android:icon="@drawable/icon_hdpi"
android:smallIcon="@drawable/icon_hdpi"
android:label="@string/authenticator_label"
/>
and permissions?