Thursday, November 10, 2011

[android-developers] Google APIs "client id" and "client secret"

I'm accessing the Picasa web service APIs via Yaniv Inbar's com.google.api.services.picasa code. I also created a Client Id and Client Secret using the Google APIs Console.

I can't quite figure out how I am supposed to pass these credentials to Picasa! My code works, but stops getting photos after a while, and I wonder if this is because I am hitting the courtesy limits that registration is supposed to allow you to get around.

I'm getting a Bundle authBundle from AccountManager.getAuthToken, and using

authToken = authBundle.getString(AccountManager.KEY_AUTHTOKEN);
final ClientLogin.Response clientLogin = new ClientLogin.Response();
clientLogin.auth = authToken;
final HttpTransport transport = AndroidHttp.newCompatibleTransport();
final HttpRequestFactory requestFactory = transport.createRequestFactory(clientLogin);

picasa = new PicasaClient(requestFactory);

to create a PicasaClient. I rather imagine that there are HttpTransport or HttpRequetsFactory methods I can call to set the Client Id and Client Secret ... but I'm sure not seeing anything obvious. 

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment