Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old December 9th, 2011, 09:46 AM   #1 (permalink)
Junior Member
 
Join Date: Sep 2011
Posts: 72
 
Device(s):
Thanks: 2
Thanked 1 Time in 1 Post
Default Google Calendar API HELP!

I'm trying to write an app that will allow me to read and write a users google calender. I've read the google tutorial on how to use the api but I'm having a really hard time. Below is my code, pretty much a copy and paste of googles. Once I reach the end of step 2 the remaing code is not execute. I've confirmed this with the eclipse debugger by setting breakpoints at that location and it doesn't break, the application just continues and pretty much skips the rest of the method. I'm sure I'm just doing something stupid, pleaes give me some guidance.

Thanks

Code:

HttpTransport httpTransport =
new NetHttpTransport(); JacksonFactory jsonFactory = new JacksonFactory(); // The clientId and clientSecret are copied from the API Access tab on
// the Google APIs Console
String clientId =
this.clientID; String clientSecret = this.clientSecret; // Or your redirect URL for web based applications.
String redirectUrl =
"urn:ietf:wg:oauth:2.0:oob"; String scope = "https://www.googleapis.com/auth/calendar"; // Step 1: Authorize -->
String authorizationUrl =
new GoogleAuthorizationRequestUrl(clientId, redirectUrl, scope) .build();
String code = some really long code;
// End of Step 1 <--
// Step 2: Exchange -->
AccessTokenResponse response =
new GoogleAuthorizationCodeGrant(httpTransport, jsonFactory, clientId, clientSecret, code, redirectUrl).execute(); // End of Step 2 <--
GoogleAccessProtectedResource accessProtectedResource =
new GoogleAccessProtectedResource( response.accessToken, httpTransport, jsonFactory, clientId, clientSecret, response.refreshToken); ///*
Calendar service = Calendar.builder(httpTransport, jsonFactory) .setApplicationName(
"YOUR_APPLICATION_NAME") .setHttpRequestInitializer(accessProtectedResource)
.build();

The_app_main is offline  
Reply With Quote
Sponsors
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 11:53 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo