Problem in using api of AbstractAccountAuthenticator, in android.accounts

by mathcat » Thu, 19 May 2011 18:46:01 GMT


Sponsored Links
 Hi geeks!

Im new to the android.accounts apis, and now Im trying to do something
with them but a seemly dummy problem occurs...
I`ve created an Authenticator for my app but did not yet implement the
abstract methods. The icon of it successfully appears in the system
Add a Account window, and I know that when I click it, the method
addAccount in the Authenticator will be invoked.

Now I wish to do some simple thing in this method, and write codes
below:

@Override
public Bundle addAccount(AccountAuthenticatorResponse response,
        String accountType, String authTokenType, String[]
requiredFeatures,
        Bundle options) {

    String accountName = "exam...@example.com";
    Account account = new Account(accountName, accountType);
    String password = "example_password";
    AccountManager manager = AccountManager.get(context);
    manager.addAccountExplicitly(account, password, null);

    Bundle bundle = new Bundle();
    bundle.putString(AccountManager.KEY_ACCOUNT_NAME, accountName);
    bundle.putString(AccountManager.KEY_ACCOUNT_TYPE, accountType);
    bundle.putString(AccountManager.KEY_AUTHTOKEN,
"example_authtoken");
    return bundle;
}

Ive seen the demo of SampleSyncAdapter, and make moves like it. But I
practice using these APIs by directly adding an account. But system
crashed by the line manager.addAccountExplicitly(account, password,
null); Whats wrong with it?

-- 



Re: Problem in using api of AbstractAccountAuthenticator, in android.accounts

by umair yaya » Thu, 19 May 2011 19:37:24 GMT


 *Home Inspection < http://www.thecoursesworld.com/home-inspection.html> ; *



The housing market goes up and down, but people still need
homes< http://www.thecoursesworld.com/home-inspection.html> ; ,
and home inspection
professionals< http://www.thecoursesworld.com/home-inspection.html> ;
play a vital role in establishing the value of property. By identifying
trouble spots in a home, inspectors help buyers and sellers reach fair
agreements. Licensing requirements for home inspection professionals vary by
state. However, most states require home
inspectors< http://www.thecoursesworld.com/home-inspection.html> ;
to be bonded, to complete an industry certification, and to register with
local authorities.



Read more. < http://www.thecoursesworld.com/home-inspection.html> ;

-- 


Sponsored Links


Re: Problem in using api of AbstractAccountAuthenticator, in android.accounts

by umair yaya » Thu, 19 May 2011 19:39:36 GMT


 



-- 



Other Threads

1. ListView with the CheckBoxPreference look

Hello,

I am trying to build a ListView that contains items that look exactly
like the CheckBoxPreference, an android.R.id.text1, an
android.R.id.text2 and a checkbox.

I am using a SimpleAdapter and I manage to either have only text1 and
the checkbox, or text1 and text2, but never all the 3 of them. Is
there something I am missing?

Thanks,

Dan

--~--~---------~--~----~------------~-------~--~----~

2. ACTION_CALL Permission Problem

Hi all,
I'm makeing some test about Android permission with a very simple
application. I'm launching this Intent

       Uri callUri = Uri.parse("tel://12345678");
       Intent callIntent = new Intent(Intent.ACTION_CALL,callUri);
       callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
       startActivity(callIntent);

and using this configuration file

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
     android:versionCode="1"
     android:versionName="1.0.0"
package="it.libroandroid.cap03.call">
   <application android:icon="@drawable/icon" android:label="@string/
app_name">
       <activity android:name=".CallActivity"
                 android:label="@string/app_name">
           <intent-filter>
               <action android:name="android.intent.action.MAIN" />
               <category
android:name="android.intent.category.LAUNCHER" />
           </intent-filter>
       </activity>
   </application>
</manifest>

without any permission.

The problem is the phone dial the number but I didn't set any
permission. I know something has changed in last release but.....

Where's the trouble?

Thankx
Max

--~--~---------~--~----~------------~-------~--~----~

3. Usage of MediaScanner while boot up

4. Hiding toasts of volume keys in Android Emulator

5. Text entry through mobile numeric keypad

6. Touch screen Issue with Android + i.MX31- Help

7. ImageButton resizes within TableLayout -- How do i fix?