1

I am developing an application in which I want to implement the twitter API and also have to load the particular URL, is it possible to load the particular URL from the API implementation? Please give me suggestion.

Thanks in advance.

dplante
2,4513 gold badges21 silver badges27 bronze badges
asked May 26, 2011 at 13:32

1 Answer 1

2

You could use: http://twitter4j.org/en/index.html or https://github.com/sugree/twitter-android-sdk

Or something like:

HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(url);
HttpResponse response;
String output ="";
try {
 response = httpclient.execute(httpget);
 HttpEntity entity = response.getEntity();
 if (entity != null) {
 InputStream instream = entity.getContent();
 //IOUtilities is a class by romanian guy...
 output = IOUtilities.readString(instream);
 instream.close();
 }
} catch (ClientProtocolException e) {
} catch (IOException e){
 Log.e(TAG, "ERROR: Failed to open GET_REQUEST "+ e);
}
answered May 26, 2011 at 13:43
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for the Response, But i have to implement the API from the scratch I haven't implement. Please provide me some tutorial to implement API for Twitter.
Thanks for this but i have already view this i had download the file which is given in this tutorial and store the jar file in my application as they mensioned in this tutorial but they cannot explain the further steps. so can you give me link of another tutorial what is tobe done with jar file after save it in my appllication.
please provide me the code which you send me before to call the URL.
but any way thanks for the code found in github.com/sugree/twitter-android-sdk which help me to login using fragment only but not activity so can i make changes to some classes to achieve some other feature of twitter

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.