I am using the following method for making an android app:
public JSONObject lastTweet(String username) throws ClientProtocolException, IOException, JSONException {
String url = "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=hodorhodorhodor";
HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet(url);
HttpResponse response = client.execute(get); //cannot execute this line
int status = response.getStatusLine().getStatusCode();
//Some more code
}
When I run the app, I get an error that the app has stopped working. After some debugging I found that the following is the line (which I have also mentioned in the above code) where my app gets stuck:
HttpResponse response = client.execute(get);
After some search online I found that it has got to do something with the twitter API 1.1 which requires some sort of OAuth authentication. Can anyone please help me here?
Thanks.