For retrieving the accounts (information) in Android versions since 2.0 you can use the AccountManager that has been introduced in Android 2.0.
But now I have the problem I want to maintain compatibility with atleast Android 1.6, is there any way to retrieve account information in Android 1.6?
http://github.com/android/platform_frameworks_opt_com.google.android/…
and add it to you build path. this is some sort of an interface to the
Google device functions.
call the method:
com.google.android.googlelogin.GoogleLoginServiceHelper.getAccount(Activity activity, int requestCode, boolean requireGoogle);
where:
Activity: is your Activity which get the result in the
onActivityResult()
requestCode: your code
requireGoogle: should be true
EX. GoogleLoginServiceHelper.getAccount(mActivity, 123, true);
3.override the onActivityResult() like:
original post is here