You will need the GET_ACCOUNTS
permission to do whatever you are trying to do. You can get the application account you create by doing something like this:
public static Account[] getAccounts(Context context) {
AccountManager accManager = AccountManager.get(context);
return accManager.getAccountsByType(ACCOUNT_TYPE);
}
Here the ACCOUNT_TYPE
refers to the type of your account that you create. This will get you back a list of the accounts, if you have multiple ones.
What do you mean by "handle sync options"?
But you can use the various static methods of the ContentResolver class to get/set the various attributes for a sync adapter. For example, to check if sync is enabled for your account you can use: