[android-developers] Re: Tut (SDK 1.5) Get google account of user
Somebody try it with Google Analytics service? I am trying to implement this method in my program but I can't get it to work. This is my code: GoogleLoginServiceHelper.getCredentials(this, 54321, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, analytics, false); I have this permissions in my manifest: uses-permission android:name=com.google.android.googleapps.permission.GOOGLE_AUTH.analytics/ uses-permission uses-permission android:name=com.google.android.googleapps.permission.GOOGLE_AUTH/ uses-permission But I got a SecurityException: java.lang.SecurityException: caller pid 6213 uid 10044 lacks com.google.android.googleapps.permission.GOOGLE_AUTH.analytics I have added this permission to manifest... any idea? With other services like Calendar Data API (cl) and YouTube Data API (youtube) i don't have any problems. -- 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
[android-developers] Re: Tut (SDK 1.5) Get google account of user
I've implemented this method to access user accounts. Sorry no answer to your q:, but you might interested to hear how I fared with this in the wild. There's two major issues: - Your app will not load on Android 2.0; the JVM will choke and complain - As far as Android 1.5 and 1.6 are concerned. Some carriers have modified this particular area of Android and their custom ROMs are incompatible with straight Android. This is an issue with Sprint (US), or the HTC Hero on a carrier in Portugal (not sure which one). I am sure, more. As an example, I've got the following (redacted) log from Portugal: 11-19 11:13:19.951 W/dalvikvm( 4795): Verifier rejected class Lcom/-/---/MyApp; 11-19 11:13:19.951 W/dalvikvm( 4795): Class init failed in newInstance call (Lcom/-/---/MyApp;) 11-19 11:13:19.951 D/AndroidRuntime( 4795): Shutting down VM 11-19 11:13:19.951 W/dalvikvm( 4795): threadid=3: thread exiting with uncaught exception (group=0x40013140) 11-19 11:13:19.951 E/AndroidRuntime( 4795): Uncaught handler: thread main exiting due to uncaught exception 11-19 11:13:19.951 E/AndroidRuntime( 4795): Uncaught handler: thread main exiting due to uncaught exception 11-19 11:13:19.961 E/AndroidRuntime( 4795): java.lang.VerifyError: com.-.---.MyApp 11-19 11:13:19.961 E/AndroidRuntime( 4795): at java.lang.Class.newInstanceImpl(Native Method) 11-19 11:13:19.961 E/AndroidRuntime( 4795): at java.lang.Class.newInstance(Class.java:1472) Again, your app won't even load. My recommendation: Don't bother to implement this, unless you're building a one off for research or for your personal enjoyment. On Dec 17, 5:21 am, Ozius ozius@gmail.com wrote: Somebody try it with Google Analytics service? I am trying to implement this method in my program but I can't get it to work. This is my code: GoogleLoginServiceHelper.getCredentials(this, 54321, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, analytics, false); I have this permissions in my manifest: uses-permission android:name=com.google.android.googleapps.permission.GOOGLE_AUTH.analytics/ uses-permission uses-permission android:name=com.google.android.googleapps.permission.GOOGLE_AUTH/ uses-permission But I got a SecurityException: java.lang.SecurityException: caller pid 6213 uid 10044 lacks com.google.android.googleapps.permission.GOOGLE_AUTH.analytics I have added this permission to manifest... any idea? With other services like Calendar Data API (cl) and YouTube Data API (youtube) i don't have any problems. -- 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
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Very interesting discussion! Thanks everybody for the precious info. Did anyone manage to get BlockingHelper to work? (or, to put it differently: is there any way to do this without the need for an activity that receives the result?) On Oct 12, 7:27 pm, kostmo kos...@gmail.com wrote: It seems I was the victim of an edge case. I had not done a factory reset of my ADP1 since Android 1.1. It works now! :) Karl On Oct 12, 1:13 am, kostmo kos...@gmail.com wrote: It seems tantalizingly close, but I still can't get the GoogleLoginService method to work with Google App Engine (GAE). I'll start with a review of the method that currently works for me. Let's say that myapp is my GAE application name and authstring is the 203-character string I get from ClientLogin. After using the user/pass prompt and traditional ClientLogin method, I can examine the cookie retrieved via curl: curl -c cookies.txt http://myapp.appspot.com/_ah/login?auth=authstring This command dumps HTML to the terminal and saves the cookie to cookies.txt. The HTML sates that the status code is 302, but in actuality the HTTP status code is 204. Anyway, these are characteristics of the cookie exchange working *properly*. The URL can be used repeatedly to get the cookie (although I don't know how long it stays valid). Now let me describe how I attempt to accomplish the same with GoogleLoginServiceHelper. I am using the method described originally by Sujay where he iterates through the methods in the GoogleLoginServiceHelper class. I look for the the getCredentials method that has the correct name and argument types and call it as follows: m.invoke( null, // This extra argument pertains to the invoke method. this, 12345, // onActivityResult code null, true, // value of the GoogleLoginServiceConstants.REQUIRE_GOOGLE constant ah, // This is the service parameter that supposedly works with GAE false); In my Manifest file, I have uses-permission android:name=com.google.android.googleapps.permission.GOOGLE_AUTH/ uses-permission in addition to uses-permission android:name=com.google.android.googleapps.permission.GOOGLE_AUTH.ah/ uses-permission . The intent passed to onActivityResult has 3 string fields: callerExtras, authtoken (the value of the GoogleLoginServiceConstants.AUTHTOKEN_KEY constant), and authAccount. I encounter the same response as before, however: when substituting the authtoken value for authstring in the above curl command, the result is 500 Server error. I am determined to get this to work! Is there possibly some configuration I'm missing on the App Engine side? Karl -- 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
[android-developers] Re: Tut (SDK 1.5) Get google account of user
It seems tantalizingly close, but I still can't get the GoogleLoginService method to work with Google App Engine (GAE). I'll start with a review of the method that currently works for me. Let's say that myapp is my GAE application name and authstring is the 203-character string I get from ClientLogin. After using the user/pass prompt and traditional ClientLogin method, I can examine the cookie retrieved via curl: curl -c cookies.txt http://myapp.appspot.com/_ah/login?auth=authstring This command dumps HTML to the terminal and saves the cookie to cookies.txt. The HTML sates that the status code is 302, but in actuality the HTTP status code is 204. Anyway, these are characteristics of the cookie exchange working *properly*. The URL can be used repeatedly to get the cookie (although I don't know how long it stays valid). Now let me describe how I attempt to accomplish the same with GoogleLoginServiceHelper. I am using the method described originally by Sujay where he iterates through the methods in the GoogleLoginServiceHelper class. I look for the the getCredentials method that has the correct name and argument types and call it as follows: m.invoke( null, // This extra argument pertains to the invoke method. this, 12345, // onActivityResult code null, true, // value of the GoogleLoginServiceConstants.REQUIRE_GOOGLE constant ah, // This is the service parameter that supposedly works with GAE false); In my Manifest file, I have uses-permission android:name=com.google.android.googleapps.permission.GOOGLE_AUTH/ uses-permission in addition to uses-permission android:name=com.google.android.googleapps.permission.GOOGLE_AUTH.ah/ uses-permission . The intent passed to onActivityResult has 3 string fields: callerExtras, authtoken (the value of the GoogleLoginServiceConstants.AUTHTOKEN_KEY constant), and authAccount. I encounter the same response as before, however: when substituting the authtoken value for authstring in the above curl command, the result is 500 Server error. I am determined to get this to work! Is there possibly some configuration I'm missing on the App Engine side? Karl --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
It seems I was the victim of an edge case. I had not done a factory reset of my ADP1 since Android 1.1. It works now! :) Karl On Oct 12, 1:13 am, kostmo kos...@gmail.com wrote: It seems tantalizingly close, but I still can't get the GoogleLoginService method to work with Google App Engine (GAE). I'll start with a review of the method that currently works for me. Let's say that myapp is my GAE application name and authstring is the 203-character string I get from ClientLogin. After using the user/pass prompt and traditional ClientLogin method, I can examine the cookie retrieved via curl: curl -c cookies.txt http://myapp.appspot.com/_ah/login?auth=authstring This command dumps HTML to the terminal and saves the cookie to cookies.txt. The HTML sates that the status code is 302, but in actuality the HTTP status code is 204. Anyway, these are characteristics of the cookie exchange working *properly*. The URL can be used repeatedly to get the cookie (although I don't know how long it stays valid). Now let me describe how I attempt to accomplish the same with GoogleLoginServiceHelper. I am using the method described originally by Sujay where he iterates through the methods in the GoogleLoginServiceHelper class. I look for the the getCredentials method that has the correct name and argument types and call it as follows: m.invoke( null, // This extra argument pertains to the invoke method. this, 12345, // onActivityResult code null, true, // value of the GoogleLoginServiceConstants.REQUIRE_GOOGLE constant ah, // This is the service parameter that supposedly works with GAE false); In my Manifest file, I have uses-permission android:name=com.google.android.googleapps.permission.GOOGLE_AUTH/ uses-permission in addition to uses-permission android:name=com.google.android.googleapps.permission.GOOGLE_AUTH.ah/ uses-permission . The intent passed to onActivityResult has 3 string fields: callerExtras, authtoken (the value of the GoogleLoginServiceConstants.AUTHTOKEN_KEY constant), and authAccount. I encounter the same response as before, however: when substituting the authtoken value for authstring in the above curl command, the result is 500 Server error. I am determined to get this to work! Is there possibly some configuration I'm missing on the App Engine side? Karl --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Hi, I've managed to get this to work for Google App Engine by specifying ah for the service parameter, for example : GoogleLoginServiceHelper.getCredentials(this, 54321, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, ah, false); This also requires permission: com.google.android.googleapps.permission.GOOGLE_AUTH.ah I don't like having to use undocumented API's, but I suppose it's better than the alternative of having the user to enter their username and password. Charlie On 10 Sep, 07:24, kostmo kos...@gmal.com wrote: been investigating whether GoogleLoginService can subsan substitute fo tLogin (seehttp://code//code.goog/apis/accounts/docs/ AuthForInstalledApps.html) on Google App Engine. To use ClientLogin, I solicit the usehe usernameassword from theom the u in a dialog and exchange them on the Google server (https:// www.google.com/accounts/ClientLogin) for a 203-character string called Auth. This Auth string can can be exchanxchafor a cookie on the application server (http://myapp.appspot.com/_ah/login?auth=...). The Value of this obtained cookie is a 460-character string. The cookie can be used from then on to maintain the user session. I was able to obtain the authtoken, aka SID, using the Ge GooglnService method described ibed in this threade authtoken obtained through this meis method happened to be 203 characters. I was hoping that the authtoken might be substituted for the the Aut string in the ClientLogin procerocethus bypassing the the need toicit the username/password. Sadly, this appears nrs not t the case. ClientLogin returns a 500 Server Error ror rather tthe 204 I usually get with a good login. So unless anyone out there is ais awto the contrary, my conclusion is that you must prompt the user for their password if you want an authenticated App Engine session. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
I have been investigating whether GoogleLoginService can substitute for ClientLogin (see http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html) on Google App Engine. To use ClientLogin, I solicit the username and password from the user in a dialog and exchange them on the Google server (https:// www.google.com/accounts/ClientLogin) for a 203-character string called Auth. This Auth string can then be exchanged for a cookie on the application server (http://myapp.appspot.com/_ah/login?auth=...). The Value of this obtained cookie is a 460-character string. The cookie can be used from then on to maintain the user session. I was able to obtain the authtoken, aka SID, using the GoogleLoginService method described in this thread. The authtoken obtained through this method also happened to be 203 characters. I was hoping that the authtoken might be substituted for the Auth string in the ClientLogin process, thus bypassing the need to solicit the username/password. Sadly, this appears not to be the case. ClientLogin returns a 500 Server Error rather than the 204 I usually get with a good login. So unless anyone out there is aware to the contrary, my conclusion is that you must prompt the user for their password if you want an authenticated App Engine session. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
You need to download framework.jar from: http://github.com/android/platform_frameworks_opt_com.google.android/blob/7e12826d58454d3bade238e3b2c43fe402278f19/framework.jar On Aug 2, 3:37 am, JP joachim.pfeif...@gmail.com wrote: Thanks for all the code - I've been trying to toy around with this but I was not able to locate the right imports or a library that includes com.google.android.googleapps. Can anybody point me where I can find that part? On Jul 25, 3:26 pm, ubikdroid markst3v...@googlemail.com wrote: Hi Karl, I call getCredentials in my Activity like this: GoogleLoginServiceHelper.getCredentials(this, 54321, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, // require google null, // This means we get the credentials for GOOGLE_AUTH.OTHER_SERVICES false); then override onActivityResult: @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent){ super.onActivityResult(requestCode, resultCode, intent); if(requestCode == 54321){ authToken = intent.getStringExtra (GoogleLoginServiceConstants.AUTHTOKEN_KEY); } } Hope that helps. On Jul 15, 11:10 pm, kostmo kos...@gmail.com wrote: Hi ubikdroid, Would you be able to tell me more about how you used getCredentials? I'm trying this variation: getCredentials (android.app.Activity,int,android.os.Bundle, java.lang.String, java.lang.String, boolean) Called from my activity, it is getCredentials(this, 345, null, email, null, false); Where 'email' is obtained from getAccount beforehand. I have added com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest. As opposed to the getAccount method, which returned an array containing the email address, the getCredentials method called with the above arguments returns null. With what arguments are you calling getCredentials? The only docs I can find relating to this (http://www.androidjavadoc.com/m5-rc15/com/google/android/googleapps/G..) seem to be outdated (wrong number of arguments). Thanks, Karl On Jun 9, 6:58 am, ubikdroid markst3v...@googlemail.com wrote: Woot! I got it working. I tried before with the service set to reader but I got a SecurityException thrown even though I had the permission in the manifest. However, if you leave the service null in the getCredentials call and add the permission com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest then it works! Thanks for the help Sujay. I was working at this for a long time! On Jun 9, 9:18 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: as i already said u need to explore the getcredentials method... in the params of that method u need to specfy wat u need n for which service... if this is done then u cangetthe sid with ease... -- Regards, Sujay Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Thanks Sergio - I did some more poking around and there seems to be a new version, here: http://github.com/android/platform_frameworks_opt_com.google.android/tree/master It's got quite a yikes-factor however - from far it appears a candidate for breakage when a new version of Android is coming out. Putting everyone in the not-supposed-to-used-undocumented-features-and- we-told-you-so corner, no? On Aug 2, 4:32 am, Sergio cur...@gmail.com wrote: You need to download framework.jar from:http://github.com/android/platform_frameworks_opt_com.google.android/... On Aug 2, 3:37 am, JP joachim.pfeif...@gmail.com wrote: Thanks for all the code - I've been trying to toy around with this but I was not able to locate the right imports or a library that includes com.google.android.googleapps. Can anybody point me where I can find that part? On Jul 25, 3:26 pm, ubikdroid markst3v...@googlemail.com wrote: Hi Karl, I call getCredentials in my Activity like this: GoogleLoginServiceHelper.getCredentials(this, 54321, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, // require google null, // This means we get the credentials for GOOGLE_AUTH.OTHER_SERVICES false); then override onActivityResult: @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent){ super.onActivityResult(requestCode, resultCode, intent); if(requestCode == 54321){ authToken = intent.getStringExtra (GoogleLoginServiceConstants.AUTHTOKEN_KEY); } } Hope that helps. On Jul 15, 11:10 pm, kostmo kos...@gmail.com wrote: Hi ubikdroid, Would you be able to tell me more about how you used getCredentials? I'm trying this variation: getCredentials (android.app.Activity,int,android.os.Bundle, java.lang.String, java.lang.String, boolean) Called from my activity, it is getCredentials(this, 345, null, email, null, false); Where 'email' is obtained from getAccount beforehand. I have added com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest. As opposed to the getAccount method, which returned an array containing the email address, the getCredentials method called with the above arguments returns null. With what arguments are you calling getCredentials? The only docs I can find relating to this (http://www.androidjavadoc.com/m5-rc15/com/google/android/googleapps/G..) seem to be outdated (wrong number of arguments). Thanks, Karl On Jun 9, 6:58 am, ubikdroid markst3v...@googlemail.com wrote: Woot! I got it working. I tried before with the service set to reader but I got a SecurityException thrown even though I had the permission in the manifest. However, if you leave the service null in the getCredentials call and add the permission com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest then it works! Thanks for the help Sujay. I was working at this for a long time! On Jun 9, 9:18 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: as i already said u need to explore the getcredentials method... in the params of that method u need to specfy wat u need n for which service... if this is done then u cangetthe sid with ease... -- Regards, Sujay Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Absolutely, however I hope the next version will have some kind of public API... On Aug 3, 3:59 am, JP joachim.pfeif...@gmail.com wrote: Thanks Sergio - I did some more poking around and there seems to be a new version, here:http://github.com/android/platform_frameworks_opt_com.google.android/... It's got quite a yikes-factor however - from far it appears a candidate for breakage when a new version of Android is coming out. Putting everyone in the not-supposed-to-used-undocumented-features-and- we-told-you-so corner, no? On Aug 2, 4:32 am, Sergio cur...@gmail.com wrote: You need to download framework.jar from:http://github.com/android/platform_frameworks_opt_com.google.android/... On Aug 2, 3:37 am, JP joachim.pfeif...@gmail.com wrote: Thanks for all the code - I've been trying to toy around with this but I was not able to locate the right imports or a library that includes com.google.android.googleapps. Can anybody point me where I can find that part? On Jul 25, 3:26 pm, ubikdroid markst3v...@googlemail.com wrote: Hi Karl, I call getCredentials in my Activity like this: GoogleLoginServiceHelper.getCredentials(this, 54321, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, // require google null, // This means we get the credentials for GOOGLE_AUTH.OTHER_SERVICES false); then override onActivityResult: @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent){ super.onActivityResult(requestCode, resultCode, intent); if(requestCode == 54321){ authToken = intent.getStringExtra (GoogleLoginServiceConstants.AUTHTOKEN_KEY); } } Hope that helps. On Jul 15, 11:10 pm, kostmo kos...@gmail.com wrote: Hi ubikdroid, Would you be able to tell me more about how you used getCredentials? I'm trying this variation: getCredentials (android.app.Activity,int,android.os.Bundle, java.lang.String, java.lang.String, boolean) Called from my activity, it is getCredentials(this, 345, null, email, null, false); Where 'email' is obtained from getAccount beforehand. I have added com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest. As opposed to the getAccount method, which returned an array containing the email address, the getCredentials method called with the above arguments returns null. With what arguments are you calling getCredentials? The only docs I can find relating to this (http://www.androidjavadoc.com/m5-rc15/com/google/android/googleapps/G..) seem to be outdated (wrong number of arguments). Thanks, Karl On Jun 9, 6:58 am, ubikdroid markst3v...@googlemail.com wrote: Woot! I got it working. I tried before with the service set to reader but I got a SecurityException thrown even though I had the permission in the manifest. However, if you leave the service null in the getCredentials call and add the permission com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest then it works! Thanks for the help Sujay. I was working at this for a long time! On Jun 9, 9:18 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: as i already said u need to explore the getcredentials method... in the params of that method u need to specfy wat u need n for which service... if this is done then u cangetthe sid with ease... -- Regards, Sujay Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Looks our needs are ahead of what's available. I also checked Open Authentication but there isn't much at this point either. On Aug 2, 3:04 pm, Sergio cur...@gmail.com wrote: Absolutely, however I hope the next version will have some kind of public API... On Aug 3, 3:59 am, JP joachim.pfeif...@gmail.com wrote: Thanks Sergio - I did some more poking around and there seems to be a new version, here:http://github.com/android/platform_frameworks_opt_com.google.android/... It's got quite a yikes-factor however - from far it appears a candidate for breakage when a new version of Android is coming out. Putting everyone in the not-supposed-to-used-undocumented-features-and- we-told-you-so corner, no? On Aug 2, 4:32 am, Sergio cur...@gmail.com wrote: You need to download framework.jar from:http://github.com/android/platform_frameworks_opt_com.google.android/... On Aug 2, 3:37 am, JP joachim.pfeif...@gmail.com wrote: Thanks for all the code - I've been trying to toy around with this but I was not able to locate the right imports or a library that includes com.google.android.googleapps. Can anybody point me where I can find that part? On Jul 25, 3:26 pm, ubikdroid markst3v...@googlemail.com wrote: Hi Karl, I call getCredentials in my Activity like this: GoogleLoginServiceHelper.getCredentials(this, 54321, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, // require google null, // This means we get the credentials for GOOGLE_AUTH.OTHER_SERVICES false); then override onActivityResult: @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent){ super.onActivityResult(requestCode, resultCode, intent); if(requestCode == 54321){ authToken = intent.getStringExtra (GoogleLoginServiceConstants.AUTHTOKEN_KEY); } } Hope that helps. On Jul 15, 11:10 pm, kostmo kos...@gmail.com wrote: Hi ubikdroid, Would you be able to tell me more about how you used getCredentials? I'm trying this variation: getCredentials (android.app.Activity,int,android.os.Bundle, java.lang.String, java.lang.String, boolean) Called from my activity, it is getCredentials(this, 345, null, email, null, false); Where 'email' is obtained from getAccount beforehand. I have added com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest. As opposed to the getAccount method, which returned an array containing the email address, the getCredentials method called with the above arguments returns null. With what arguments are you calling getCredentials? The only docs I can find relating to this (http://www.androidjavadoc.com/m5-rc15/com/google/android/googleapps/G..) seem to be outdated (wrong number of arguments). Thanks, Karl On Jun 9, 6:58 am, ubikdroid markst3v...@googlemail.com wrote: Woot! I got it working. I tried before with the service set to reader but I got a SecurityException thrown even though I had the permission in the manifest. However, if you leave the service null in the getCredentials call and add the permission com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest then it works! Thanks for the help Sujay. I was working at this for a long time! On Jun 9, 9:18 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: as i already said u need to explore the getcredentials method... in the params of that method u need to specfy wat u need n for which service... if this is done then u cangetthe sid with ease... -- Regards, Sujay Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Sergio, i dont think this'd work on an emulator... U need to have configured atleast once into any of google's services before u r able to get any results. On Fri, Jul 31, 2009 at 2:52 PM, Sergio cur...@gmail.com wrote: My intent seems to be empty for an errorcode key with a value of 0. Cheers On Jul 26, 10:26 am, ubikdroid markst3v...@googlemail.com wrote: Hi Karl, I call getCredentials in my Activity like this: GoogleLoginServiceHelper.getCredentials(this, 54321, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, // require google null, // This means we get the credentials for GOOGLE_AUTH.OTHER_SERVICES false); then override onActivityResult: @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent){ super.onActivityResult(requestCode, resultCode, intent); if(requestCode == 54321){ authToken = intent.getStringExtra (GoogleLoginServiceConstants.AUTHTOKEN_KEY); } } Hope that helps. On Jul 15, 11:10 pm, kostmo kos...@gmail.com wrote: Hi ubikdroid, Would you be able to tell me more about how you used getCredentials? I'm trying this variation: getCredentials (android.app.Activity,int,android.os.Bundle, java.lang.String, java.lang.String, boolean) Called from my activity, it is getCredentials(this, 345, null, email, null, false); Where 'email' is obtained from getAccount beforehand. I have added com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest. As opposed to the getAccount method, which returned an array containing the email address, the getCredentials method called with the above arguments returns null. With what arguments are you calling getCredentials? The only docs I can find relating to this ( http://www.androidjavadoc.com/m5-rc15/com/google/android/googleapps/G. .) seem to be outdated (wrong number of arguments). Thanks, Karl On Jun 9, 6:58 am, ubikdroid markst3v...@googlemail.com wrote: Woot! I got it working. I tried before with the service set to reader but I got a SecurityException thrown even though I had the permission in the manifest. However, if you leave the service null in the getCredentials call and add the permission com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest then it works! Thanks for the help Sujay. I was working at this for a long time! On Jun 9, 9:18 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: as i already said u need to explore the getcredentials method... in the params of that method u need to specfy wat u need n for which service... if this is done then u cangetthe sid with ease... -- Regards, Sujay Josh Billings http://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. -- Regards, Sujay Mike Ditka http://www.brainyquote.com/quotes/authors/m/mike_ditka.html - If God had wanted man to play soccer, he wouldn't have given us arms. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Hi Sujay, Thanks for your reply. I configured email in the emulator and it was working properly, I could see my emails, so I thought that the GoogleLoginServiceHelper would be able to work. Cheers Sergio On Aug 1, 7:29 pm, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Sergio, i dont think this'd work on an emulator... U need to have configured atleast once into any of google's services before u r able to get any results. On Fri, Jul 31, 2009 at 2:52 PM, Sergio cur...@gmail.com wrote: My intent seems to be empty for an errorcode key with a value of 0. Cheers On Jul 26, 10:26 am, ubikdroid markst3v...@googlemail.com wrote: Hi Karl, I call getCredentials in my Activity like this: GoogleLoginServiceHelper.getCredentials(this, 54321, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, // require google null, // This means we get the credentials for GOOGLE_AUTH.OTHER_SERVICES false); then override onActivityResult: @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent){ super.onActivityResult(requestCode, resultCode, intent); if(requestCode == 54321){ authToken = intent.getStringExtra (GoogleLoginServiceConstants.AUTHTOKEN_KEY); } } Hope that helps. On Jul 15, 11:10 pm, kostmo kos...@gmail.com wrote: Hi ubikdroid, Would you be able to tell me more about how you used getCredentials? I'm trying this variation: getCredentials (android.app.Activity,int,android.os.Bundle, java.lang.String, java.lang.String, boolean) Called from my activity, it is getCredentials(this, 345, null, email, null, false); Where 'email' is obtained from getAccount beforehand. I have added com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest. As opposed to the getAccount method, which returned an array containing the email address, the getCredentials method called with the above arguments returns null. With what arguments are you calling getCredentials? The only docs I can find relating to this ( http://www.androidjavadoc.com/m5-rc15/com/google/android/googleapps/G. .) seem to be outdated (wrong number of arguments). Thanks, Karl On Jun 9, 6:58 am, ubikdroid markst3v...@googlemail.com wrote: Woot! I got it working. I tried before with the service set to reader but I got a SecurityException thrown even though I had the permission in the manifest. However, if you leave the service null in the getCredentials call and add the permission com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest then it works! Thanks for the help Sujay. I was working at this for a long time! On Jun 9, 9:18 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: as i already said u need to explore the getcredentials method... in the params of that method u need to specfy wat u need n for which service... if this is done then u cangetthe sid with ease... -- Regards, Sujay Josh Billings http://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. -- Regards, Sujay Mike Ditka http://www.brainyquote.com/quotes/authors/m/mike_ditka.html - If God had wanted man to play soccer, he wouldn't have given us arms. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Thanks for all the code - I've been trying to toy around with this but I was not able to locate the right imports or a library that includes com.google.android.googleapps. Can anybody point me where I can find that part? On Jul 25, 3:26 pm, ubikdroid markst3v...@googlemail.com wrote: Hi Karl, I call getCredentials in my Activity like this: GoogleLoginServiceHelper.getCredentials(this, 54321, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, // require google null, // This means we get the credentials for GOOGLE_AUTH.OTHER_SERVICES false); then override onActivityResult: @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent){ super.onActivityResult(requestCode, resultCode, intent); if(requestCode == 54321){ authToken = intent.getStringExtra (GoogleLoginServiceConstants.AUTHTOKEN_KEY); } } Hope that helps. On Jul 15, 11:10 pm, kostmo kos...@gmail.com wrote: Hi ubikdroid, Would you be able to tell me more about how you used getCredentials? I'm trying this variation: getCredentials (android.app.Activity,int,android.os.Bundle, java.lang.String, java.lang.String, boolean) Called from my activity, it is getCredentials(this, 345, null, email, null, false); Where 'email' is obtained from getAccount beforehand. I have added com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest. As opposed to the getAccount method, which returned an array containing the email address, the getCredentials method called with the above arguments returns null. With what arguments are you calling getCredentials? The only docs I can find relating to this (http://www.androidjavadoc.com/m5-rc15/com/google/android/googleapps/G..) seem to be outdated (wrong number of arguments). Thanks, Karl On Jun 9, 6:58 am, ubikdroid markst3v...@googlemail.com wrote: Woot! I got it working. I tried before with the service set to reader but I got a SecurityException thrown even though I had the permission in the manifest. However, if you leave the service null in the getCredentials call and add the permission com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest then it works! Thanks for the help Sujay. I was working at this for a long time! On Jun 9, 9:18 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: as i already said u need to explore the getcredentials method... in the params of that method u need to specfy wat u need n for which service... if this is done then u cangetthe sid with ease... -- Regards, Sujay Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Hi there, Does this work in the emulator? I am always getting null in the intent data Cheers Sergio On Jul 26, 10:26 am, ubikdroid markst3v...@googlemail.com wrote: Hi Karl, I call getCredentials in my Activity like this: GoogleLoginServiceHelper.getCredentials(this, 54321, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, // require google null, // This means we get the credentials for GOOGLE_AUTH.OTHER_SERVICES false); then override onActivityResult: @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent){ super.onActivityResult(requestCode, resultCode, intent); if(requestCode == 54321){ authToken = intent.getStringExtra (GoogleLoginServiceConstants.AUTHTOKEN_KEY); } } Hope that helps. On Jul 15, 11:10 pm, kostmo kos...@gmail.com wrote: Hi ubikdroid, Would you be able to tell me more about how you used getCredentials? I'm trying this variation: getCredentials (android.app.Activity,int,android.os.Bundle, java.lang.String, java.lang.String, boolean) Called from my activity, it is getCredentials(this, 345, null, email, null, false); Where 'email' is obtained from getAccount beforehand. I have added com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest. As opposed to the getAccount method, which returned an array containing the email address, the getCredentials method called with the above arguments returns null. With what arguments are you calling getCredentials? The only docs I can find relating to this (http://www.androidjavadoc.com/m5-rc15/com/google/android/googleapps/G..) seem to be outdated (wrong number of arguments). Thanks, Karl On Jun 9, 6:58 am, ubikdroid markst3v...@googlemail.com wrote: Woot! I got it working. I tried before with the service set to reader but I got a SecurityException thrown even though I had the permission in the manifest. However, if you leave the service null in the getCredentials call and add the permission com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest then it works! Thanks for the help Sujay. I was working at this for a long time! On Jun 9, 9:18 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: as i already said u need to explore the getcredentials method... in the params of that method u need to specfy wat u need n for which service... if this is done then u cangetthe sid with ease... -- Regards, Sujay Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
My intent seems to be empty for an errorcode key with a value of 0. Cheers On Jul 26, 10:26 am, ubikdroid markst3v...@googlemail.com wrote: Hi Karl, I call getCredentials in my Activity like this: GoogleLoginServiceHelper.getCredentials(this, 54321, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, // require google null, // This means we get the credentials for GOOGLE_AUTH.OTHER_SERVICES false); then override onActivityResult: @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent){ super.onActivityResult(requestCode, resultCode, intent); if(requestCode == 54321){ authToken = intent.getStringExtra (GoogleLoginServiceConstants.AUTHTOKEN_KEY); } } Hope that helps. On Jul 15, 11:10 pm, kostmo kos...@gmail.com wrote: Hi ubikdroid, Would you be able to tell me more about how you used getCredentials? I'm trying this variation: getCredentials (android.app.Activity,int,android.os.Bundle, java.lang.String, java.lang.String, boolean) Called from my activity, it is getCredentials(this, 345, null, email, null, false); Where 'email' is obtained from getAccount beforehand. I have added com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest. As opposed to the getAccount method, which returned an array containing the email address, the getCredentials method called with the above arguments returns null. With what arguments are you calling getCredentials? The only docs I can find relating to this (http://www.androidjavadoc.com/m5-rc15/com/google/android/googleapps/G..) seem to be outdated (wrong number of arguments). Thanks, Karl On Jun 9, 6:58 am, ubikdroid markst3v...@googlemail.com wrote: Woot! I got it working. I tried before with the service set to reader but I got a SecurityException thrown even though I had the permission in the manifest. However, if you leave the service null in the getCredentials call and add the permission com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest then it works! Thanks for the help Sujay. I was working at this for a long time! On Jun 9, 9:18 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: as i already said u need to explore the getcredentials method... in the params of that method u need to specfy wat u need n for which service... if this is done then u cangetthe sid with ease... -- Regards, Sujay Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Hi Karl, I call getCredentials in my Activity like this: GoogleLoginServiceHelper.getCredentials(this, 54321, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, // require google null, // This means we get the credentials for GOOGLE_AUTH.OTHER_SERVICES false); then override onActivityResult: @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent){ super.onActivityResult(requestCode, resultCode, intent); if(requestCode == 54321){ authToken = intent.getStringExtra (GoogleLoginServiceConstants.AUTHTOKEN_KEY); } } Hope that helps. On Jul 15, 11:10 pm, kostmo kos...@gmail.com wrote: Hi ubikdroid, Would you be able to tell me more about how you used getCredentials? I'm trying this variation: getCredentials (android.app.Activity,int,android.os.Bundle, java.lang.String, java.lang.String, boolean) Called from my activity, it is getCredentials(this, 345, null, email, null, false); Where 'email' is obtained from getAccount beforehand. I have added com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest. As opposed to the getAccount method, which returned an array containing the email address, the getCredentials method called with the above arguments returns null. With what arguments are you calling getCredentials? The only docs I can find relating to this (http://www.androidjavadoc.com/m5-rc15/com/google/android/googleapps/GoogleLo...) seem to be outdated (wrong number of arguments). Thanks, Karl On Jun 9, 6:58 am, ubikdroid markst3v...@googlemail.com wrote: Woot! I got it working. I tried before with the service set to reader but I got a SecurityException thrown even though I had the permission in the manifest. However, if you leave the service null in the getCredentials call and add the permission com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest then it works! Thanks for the help Sujay. I was working at this for a long time! On Jun 9, 9:18 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: as i already said u need to explore the getcredentials method... in the params of that method u need to specfy wat u need n for which service... if this is done then u cangetthe sid with ease... -- Regards, Sujay Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Hi ubikdroid, Would you be able to tell me more about how you used getCredentials? I'm trying this variation: getCredentials (android.app.Activity,int,android.os.Bundle, java.lang.String, java.lang.String, boolean) Called from my activity, it is getCredentials(this, 345, null, email, null, false); Where 'email' is obtained from getAccount beforehand. I have added com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest. As opposed to the getAccount method, which returned an array containing the email address, the getCredentials method called with the above arguments returns null. With what arguments are you calling getCredentials? The only docs I can find relating to this (http:// www.androidjavadoc.com/m5-rc15/com/google/android/googleapps/GoogleLoginServiceHelper.html) seem to be outdated (wrong number of arguments). Thanks, Karl On Jun 9, 6:58 am, ubikdroid markst3v...@googlemail.com wrote: Woot! I got it working. I tried before with the service set to reader but I got a SecurityException thrown even though I had the permission in the manifest. However, if you leave the service null in the getCredentials call and add the permission com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest then it works! Thanks for the help Sujay. I was working at this for a long time! On Jun 9, 9:18 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: as i already said u need to explore the getcredentials method... in the params of that method u need to specfy wat u need n for which service... if this is done then u cangetthe sid with ease... -- Regards, Sujay Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Tell me more! I'm not sure what you mean by very simple more efficient time using this. I'm trying to create a widget that gets the number of unread items from the Google Reader API. The auth token from android doesn't seem to be valid for this. I'm having to resort to asking the user to input their password (your post helped me get the username) before obtaining a SID from the Google ClientLogin API which isn't ideal. Any help much appreciated. Mark On Jun 9, 6:08 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: this tut is actually to help u get those credentials without having to worry abt anything... if u hv enough time to explore then there's definitely a very simple more efficient time using this... rather than forming ur own http requests... -- Regards, Sujay Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
as i already said u need to explore the getcredentials method... in the params of that method u need to specfy wat u need n for which service... if this is done then u can get the sid with ease... On Tue, Jun 9, 2009 at 1:40 PM, ubikdroid markst3v...@googlemail.comwrote: Tell me more! I'm not sure what you mean by very simple more efficient time using this. I'm trying to create a widget that gets the number of unread items from the Google Reader API. The auth token from android doesn't seem to be valid for this. I'm having to resort to asking the user to input their password (your post helped me get the username) before obtaining a SID from the Google ClientLogin API which isn't ideal. Any help much appreciated. Mark On Jun 9, 6:08 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: this tut is actually to help u get those credentials without having to worry abt anything... if u hv enough time to explore then there's definitely a very simple more efficient time using this... rather than forming ur own http requests... -- Regards, Sujay Josh Billings http://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. -- Regards, Sujay Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Woot! I got it working. I tried before with the service set to reader but I got a SecurityException thrown even though I had the permission in the manifest. However, if you leave the service null in the getCredentials call and add the permission com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to the manifest then it works! Thanks for the help Sujay. I was working at this for a long time! On Jun 9, 9:18 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: as i already said u need to explore the getcredentials method... in the params of that method u need to specfy wat u need n for which service... if this is done then u can get the sid with ease... -- Regards, Sujay Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Dear Android, Thank for your info. On 6/9/09, ubikdroid markst3v...@googlemail.com wrote: Tell me more! I'm not sure what you mean by very simple more efficient time using this. I'm trying to create a widget that gets the number of unread items from the Google Reader API. The auth token from android doesn't seem to be valid for this. I'm having to resort to asking the user to input their password (your post helped me get the username) before obtaining a SID from the Google ClientLogin API which isn't ideal. Any help much appreciated. Mark On Jun 9, 6:08 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: this tut is actually to help u get those credentials without having to worry abt anything... if u hv enough time to explore then there's definitely a very simple more efficient time using this... rather than forming ur own http requests... -- Regards, Sujay Josh Billings http://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. -- Rey campoes city in the gank --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
I tried to use the auth token as a SID to login to http://www.google.com/reader/api/0/unread-count from a widget and it didn't work. I had to resort to using the ClientLogin API to get a valid SID. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
this tut is actually to help u get those credentials without having to worry abt anything... if u hv enough time to explore then there's definitely a very simple more efficient time using this... rather than forming ur own http requests... On Sat, Jun 6, 2009 at 2:24 AM, ubikdroid markst3v...@googlemail.comwrote: I tried to use the auth token as a SID to login to http://www.google.com/reader/api/0/unread-count from a widget and it didn't work. I had to resort to using the ClientLogin API to get a valid SID. -- Regards, Sujay Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Hi Sujay What tut are you talking about ? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
I started this discussion to provide a tut for ppl interacting with google services frm their app... plz chk out my 1st post On Tue, Jun 9, 2009 at 10:41 AM, André Charles Legendre andre.legen...@gmail.com wrote: Hi Sujay What tut are you talking about ? -- Regards, Sujay Dave Barry http://www.brainyquote.com/quotes/authors/d/dave_barry.html - Camping is nature's way of promoting the motel business. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
Does this code allow you to get the email address of the phones owner, used when setting up the phone? I.e. the email address of the google account tied to to the phone? On Jun 5, 7:54 am, 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).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) -- 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
to be more specific it gives the interface that is used by other google apps to get user credentials... it also provides methods with which u can get the auth token or invalidate the token(logout)... On Fri, Jun 5, 2009 at 5:27 PM, mscwd01 mscw...@gmail.com wrote: Does this code allow you to get the email address of the phones owner, used when setting up the phone? I.e. the email address of the google account tied to to the phone? On Jun 5, 7:54 am, 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).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) -- Regards, Sujay Mark Twain http://www.brainyquote.com/quotes/authors/m/mark_twain.html - There is no sadder sight than a young pessimist. -- Regards, Sujay Will Rogers http://www.brainyquote.com/quotes/authors/w/will_rogers.html - I never expected to see the day when girls would get sunburned in the places they now do. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Tut (SDK 1.5) Get google account of user
u need certain permissions for this which tells the user that whether the app only reads the email id or if it trys to get the auth token... so the user'll no at the time of installing the app itself... On Fri, Jun 5, 2009 at 7:12 PM, mscwd01 mscw...@gmail.com wrote: Hmm, while this could be useful isn't it a major privacy issue? Imagine unscrupilous developers getting the auth token and then logging into the users gmail account etc? Or have I misunderstood something here? On Jun 5, 1:06 pm, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: to be more specific it gives the interface that is used by other google apps to get user credentials... it also provides methods with which u can get the auth token or invalidate the token(logout)... On Fri, Jun 5, 2009 at 5:27 PM, mscwd01 mscw...@gmail.com wrote: Does this code allow you to get the email address of the phones owner, used when setting up the phone? I.e. the email address of the google account tied to to the phone? On Jun 5, 7:54 am, 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).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) -- Regards, Sujay Mark Twain http://www.brainyquote.com/quotes/authors/m/mark_twain.html - There is no sadder sight than a young pessimist. -- Regards, Sujay Will Rogers http://www.brainyquote.com/quotes/authors/w/will_rogers.html - I never expected to see the day when girls would get sunburned in the places they now do. -- 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 -~--~~~~--~~--~--~---