Bump. Star. Tag. Etc. While I imagine this will eventually be "fixed" in a future release we can only hope that Google gives developers some alternative (ie: better) way to get a UID for a given user so we can save profiles, etc. for our apps online and keep them associated with a user without them having to login separately to our application (which is a much bigger security problem in my eyes). Even better would be if there was a secure, reliable and supported way for an application to get authenticated tokens so our application could interact with their Google data (ie: get inbox count, save to Google Docs, connect to Jabber network, etc.)
On Jun 4, 11:54 pm, Sujay Krishna Suresh <sujay.coold...@gmail.com> wrote: > hi guys i finally got a simple method to get the google accounts in SDK > 1.5... > i'm attaching the code for everyone who needs this piece of code... > This piece of code prints all methods in the class & invokes the static > method getAccount... > try { > for (Method ele : > Class.forName("com.google.android.googlelogin.GoogleLoginServiceHelper").ge > tMethods()) > { > System.out.println(ele.toString()); > try { > if(ele.getName().equals("getAccount")) > ele.invoke(null, this, 123, true); > } catch (IllegalArgumentException e) { > e.printStackTrace(); > } catch (IllegalAccessException e) { > e.printStackTrace(); > } catch (InvocationTargetException e) { > e.printStackTrace(); > } > } > } catch (ClassNotFoundException e) { > e.printStackTrace(); > } > > } catch (ClassNotFoundException e) { > e.printStackTrace(); > } > > & jus place the foll code in ur onactivityresult > 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[0] != null) > usernameText.setText("You are : " + accounts[0].replace("@gmail.com", > "")); > } > in the logcat/ddms o/p u'll be able to see that there are other useful > methods... > public static void > com.google.android.googlelogin.GoogleLoginServiceHelper.getCredentials(andr > oid.app.Activity,int,android.os.Bundle,java.lang.String,java.lang.String,bo > olean) > public static void > com.google.android.googlelogin.GoogleLoginServiceHelper.getCredentials(andr > oid.app.Activity,int,android.os.Bundle,boolean,java.lang.String,boolean) > public static void > com.google.android.googlelogin.GoogleLoginServiceHelper.invalidateAuthToken > (android.app.Activity,int,java.lang.String) > > -- > Regards, > Sujay > Mark Twain <http://www.brainyquote.com/quotes/authors/m/mark_twain.html> - > "There is no sadder sight than a young pessimist." --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---