I also tried using it... But according to one of the developers its not
usable in android (or any other mob platform)....
if u jus need a lil data from google then try this...
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").getMethods())
{
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(android.app.Activity,int,android.os.Bundle,java.lang.String,java.lang.String,boolean)
public static void
com.google.android.googlelogin.GoogleLoginServiceHelper.getCredentials(android.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)
N wats the service that u wanna use???
On Sat, Jun 13, 2009 at 12:27 PM, Patrick <[email protected]> wrote:
>
> Has anyone had success using Google Data APIs Client Libraries. I
> can’t seem to successfully use the GData Java client libraries in an
> Android app. I notice that there used to be some GData access classes
> in the Wireless packages that have been removed. Should I be using
> some map data classes in the com.google.android.maps classes I’m not
> seeing? I started to go down the path of accessing data through raw
> http calls, but it’s a beating.
>
> Any advice would be much appreciated.
>
> Thanks,
>
> Patrick
> >
>
--
Regards,
Sujay
Groucho Marx <http://www.brainyquote.com/quotes/authors/g/groucho_marx.html>
- "I was married by a judge. I should have asked for a jury."
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---