Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
hi fellow developers ,
 
I am developing a android application in which i want my datasource to be Google spread sheets.I am begineer in this .I only know this part for getting google access token.What else do i have to do to access the google gmail spread sheets
i have also created a account manager
Please let me know the further steps.
 
I google it but i got the code for .net only for OAuth2
I need the OAuth2 for JAVA
 

import com.google.gdata.client.authn.oauth.*;
import com.google.gdata.util.*;
import com.google.gdata.client.docs.*;
import com.google.gdata.data.spreadsheet.*;
import com.google.api.client.auth.oauth2.*;
import com.google.api.client.auth.oauth2.AuthorizationCodeRequestUrl;
import com.google.api.client.auth.oauth2.TokenRequest;
 

 

 

@SuppressWarnings("unused")
public class oauth
{
    // Google code console info
    String Client_ID = "myid";
    String Client_Secret = "key";
    String scope = "https://spreadsheets.google.com/feeds https://docs.google.com/feeds";
    String Redirec_Url = "url";
 
    //setting oAuth2
//What to do,,, Please tell if any other library required 
                 AccountManager am = AccountManager.get(this);//this denotes to the activity 
		Bundle options = new Bundle();
   
		Account[] abc = am.getAccountsByType("com.google");
 
}
elp me out ..i gogle it but found code for .net for OAuth2 ineed the code in JAVA
Thanks in advance
aksh619
Posted 21-Jan-13 2:27am
Edited 23-Jan-13 20:57pm
v2
Comments
Aksh@169 at 24-Jan-13 1:53am
   
Help me out someone.. i am stuck . .

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

First hit on google using "android OAuth2" is
 
Authenticating to OAuth2 Services[^]
 
should do the trick
 
/Darren
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Sergey Alexandrovich Kryukov 85
4 Afzaal Ahmad Zeeshan 82
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web03 | 2.8.1411022.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100