Phoenixasuga / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

GoogleAuthorizationCodeTokenRequest gives me error NetworkOnMainThread #537

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-api-java-client (e.g. 1.5.0-beta)?1.9.0-beta

Java environment (e.g. Java 6, Android 2.3, App Engine)?Android 4.0.3

Describe the problem.
I am trying to implement Youtube app. after authorization in the webpage is 
successful i am trying to get the Authorizationcode using the API 
"GoogleAuthorizationCodeTokenRequest.execute".

when i try to run this code in a seperate thread also it is giving me an 
Exception "NetworkOnMainThread". If i am running it in a AsyncTask it is 
working properly.

How would you expect it to be fixed?
How to tun the above API with out getting the above exception in a seperate 
thread

Original issue reported on code.google.com by kamesh.S...@gmail.com on 21 Jun 2012 at 4:06

GoogleCodeExporter commented 9 years ago
For OAuth 2.0, you should really use Google Play services which is launching 
soon:

https://developers.google.com/android/google-play-services/

Alternatively, use AccountManager.

Original comment by yan...@google.com on 14 Jul 2012 at 11:17

GoogleCodeExporter commented 9 years ago
Thank you for the reply...

As per the documentation i found that for the services other than "youtube" 
google providing the libraries to get the data uasing the key(the key which we 
are getting after user authorization. But i am not able find the libs which i 
should use for "youtube" app developement. can u share me the libs to get the 
data which i can use the with the key we are getting using the account manager.

It is very important task for me...

Original comment by kamesh.S...@gmail.com on 14 Jul 2012 at 8:22