Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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


C#
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
Updated 23-Jan-13 19:57pm
v2
Comments
Aksh@169 24-Jan-13 1:53am    
Help me out someone.. i am stuck . .

1 solution

First hit on google using "android OAuth2" is

Authenticating to OAuth2 Services[^]

should do the trick

/Darren
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900