There's no current way that I know of to get the user's actual gmail and password, but as this thread notes, you can generate a valid authToken from the user's gmail account on their phone:
http://groups.google.com/group/android-developers/browse_thread/thread/be16e3903442931b/dc2d3126055dc251?lnk=gst&q=authtoken#dc2d3126055dc251 The user doesn't have to enter their credentials. Of course, this only works with the new Account Manager API, which is only in 2.0 or greater. Here's a working snippet for getting the authToken: AccountManager mgr = AccountManager.get(thisActivity); Account[] accts = mgr.getAccountsByType("com.google"); Account acct = accts[0]; AccountManagerFuture<Bundle> accountManagerFuture = mgr.getAuthToken (acct, "ah", null, thisActivity, null, null); Bundle authTokenBundle = accountManagerFuture.getResult(); authToken = authTokenBundle.get (AccountManager.KEY_AUTHTOKEN).toString(); You can use this code instead of calling Benjamin's GetToken method. A couple of things...there is more than one getAuthToken method. You need to use the one that passes in the current activity. This will launch a system notification that warns the user that your app wants to use the credentials from their Google account. If they accept, they are never prompted again. Also, you need to add the GET_ACCOUNTS and USE_CREDENTIALS permissions to your manifest. I'm working on a turn-based multiplayer game using Google App Engine as the server. We've got all this authentication junk worked out, which was a pain in the butt, but we're having some very slow performance (not just on the Android client, but on the browser one as well, so something's not quite right with the way we're reading or writing data to the DB). Anyway, hope this helps. On Dec 28, 9:36 am, Dan Sherman <[email protected]> wrote: > Thanks for the class, looks pretty good. > > Question though, as far as I'm aware, theres no way to get that user's gmail > account from the phone, so the user has to enter the credentials at the > start of the app, correct? > > - Dan > > > > On Sat, Dec 26, 2009 at 12:01 PM, Benjamin <[email protected]> wrote: > > I've been working for the past couple of days to allow users to login > > to an android app with their gmail account and pass the authentication > > token to my app hosted on app engine - so i can download xml from my > > web services hosted on app engine as if the user logged into the app > > directly. > > > There is a lot of info on ways to get the google auth code and the > > auth cookie and then pass the cookie in the header of an http request > > - but no info out there on doing all of this from android and going > > as far as to add the cookie to the remaining http requests. So, now > > that's it's working, i thought i'd compile it all together and post > > the solution here in my blog - enjoy. > > >http://javagwt.blogspot.com/2009/12/authenticating-android-app-to-goo... > > > -- > > 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]<android-developers%2Bunsubs > > [email protected]> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en -- 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

