我正在开发一个应用程序,我想在其中实现 Twitter API 并且还必须加载特定的 URL,是否可以从 API 实现中加载特定的 URL?请给我建议。
提前致谢。
最佳答案
您可以使用:http://twitter4j.org/en/index.html或 https://github.com/sugree/twitter-android-sdk
或者类似的东西:
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);
}
关于android - Android 上的 Twitter API 实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6139317/