v1.1 Api issue on Android HttpGet


I am working on Search Api v1.1 at Android. I have token and secret and I use them like that:

HttpGet get = new HttpGet( "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi&count=2"); HttpParams params = new BasicHttpParams(); HttpProtocolParams.setUseExpectContinue(params, false); get.setParams(params);
try {
    SharedPreferences settings = getBaseContext().getSharedPreferences(
            "your_app_prefs", 0);
    String userKey = settings.getString("user_key2", "");
    String userSecret = settings.getString("user_secret2", "");

    httpOauthConsumer.setTokenWithSecret(userKey, userSecret);

    DefaultHttpClient client = new DefaultHttpClient();
    String response = client.execute(get, new BasicResponseHandler());
    JSONArray array = new JSONArray(response);
} catch (Exception e) {
    // handle this somehow

The code is working well and the tweets comes to me. But whenever I want to change the URL being
nothing hapenning I cant get any tweet and the LogChat doesn’t gets error.

But one warning comes to me for both URL request.
06-25 00:35:14.300: W/ResponseProcessCookies(7474): Invalid cookie header: “set-cookie: guest_id=v1%3A137210970804780170; Domain=.twitter.com; Path=/; Expires=Wed, 24-Jun-2015 21:35:08 UTC”. Unable to parse expires attribute: Wed, 24-Jun-2015 21:35:08 UTC
I dont’t think the warning not the reason of issue. Because you know first URL request is working well.

Can any one help? Thanks so much.


When I try that URL, I get a valid response with zero results. If I remove the since_id parameter, I get results. I think you’re just seeing a search constrained such that it has no results.


i use this code but it is not working …can you send the proper code to use twitter api 1.1 for getting tweets