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 1:27am
Edited 23-Jan-13 19: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 Sergey Alexandrovich Kryukov 696
1 OriginalGriff 478
2 Tadit Dash 400
3 sanket saxena 337
4 Peter Leow 228
0 Sergey Alexandrovich Kryukov 11,890
1 OriginalGriff 7,335
2 Peter Leow 5,003
3 Abhinav S 3,943
4 Maciej Los 3,575


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