I am trying to integrate google in my android app. I am using oauth for retriving request token, access token. I want User's FirstName, LastName, ScreenName, Email. Here is what I am trying to do,
public static final String CLIENT_ID = "XXXX";
public static final String CLIENT_SECRET = "XXXX";
private static final String SCOPE = "https://www.googleapis.com/auth/userinfo.profile";
public static final String REQUEST_TOKEN_URL = "https://www.google.com/accounts/OAuthGetRequestToken";
public static final String ACCESS_TOKEN_URL = "https://www.google.com/accounts/OAuthGetAccessToken";
public static final String AUTHORIZE_URL = "https://www.google.com/accounts/OAuthAuthorizeToken";
I get connected to google asking to grant access for profile information. User grants the access, comes back to my application. Now I am trying to do this,
DefaultHttpClient httpClient = new DefaultHttpClient();
String strUrl = "https://www.googleapis.com/oauth2/v1/userinfo?alt=json";
HttpPost request = new HttpPost(strUrl);
to get the user's profile. But In response I get only
{
No data. I tried a lot to get the user profile. Plz do tell me where I am doing wrong. Any links, sample code will be appreciated. Thanks in advance.