Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<ol> <li>download the framework.jar from: <a href="http://github.com/android/platform_frameworks_opt_com.google.android/" rel="nofollow noreferrer">http://github.com/android/platform_frameworks_opt_com.google.android/</a>... and add it to you build path. this is some sort of an interface to the Google device functions. </li> <li><p>call the method: </p> <p>com.google.android.googlelogin.GoogleLoginServiceHelper.getAccount(Activity activity, int requestCode, boolean requireGoogle);</p> <p>where: Activity: is your Activity which get the result in the onActivityResult() requestCode: your code requireGoogle: should be true </p> <p>EX. GoogleLoginServiceHelper.getAccount(mActivity, 123, true); </p></li> </ol> <p>3.override the onActivityResult() like: </p> <pre><code> protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode == 123){ System.out.println(resultCode); String key = "accounts"; System.out.println(key + ":" + Arrays.toString(data.getExtras().getStringArray(key))); String accounts[] = data.getExtras().getStringArray(key); if(accounts != null){ int i = 0; for(String ac : accounts){ //each account is the full email address registered with this device System.out.println("ac " + i + "=" + ac); i++; } } } </code></pre> <p>original post is <a href="http://www.google.com/url?sa=D&amp;q=http://groups.google.com/group/android-developers/browse_thread/thread/7a6bf77910ca31e0/7a7659d61a89fa41%3Flnk%3Dgst%26q%3Dhow%2Bcan%2BI%2Bget%2Bthe%2BGoogle%2Baccount%2Bor%2BGmail%2Baddress%2Bfrom%2Bthe%2Bphone%237a7659d61a89fa41&amp;usg=AFQjCNHjHC0BihXAkabib4ScyoqHPc3w4Q" rel="nofollow noreferrer">here</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload