String url= "url?access_token=" +access_token;
HttpGet request=new httpget (URL);
System.out.println ("Saved access_token=" +access_token);
HttpClient client=new getdefaultclient (). Getnewhttpclient ();
Try
{
HttpResponse Response=client.execute (Request);
int Code=response.getstatusline (). Getstatuscode ();
if (code = = 200)
{
InputStream is = Response.getentity (). getcontent ();
BufferedReader reader = new BufferedReader (new InputStreamReader (IS, "UTF-8"));
StringBuilder buffer = new StringBuilder ();
Try
{
String Line;
while ((Line=reader.readline ())!=null)
{
Buffer.append (line);
}
} finally
{
Reader.close ();
}
String string = Buffer.tostring ();
System.out.println (string);
return Integer.parseint (String);
}
} catch (Unsupportedencodingexception e)
{
TODO auto-generated Catch block
E.printstacktrace ();
} catch (Clientprotocolexception e)
{
TODO auto-generated Catch block
E.printstacktrace ();
} catch (IOException e)
{
TODO auto-generated Catch block
E.printstacktrace ();
}
}
How to use the obtained OAUTH2.0 access token call API