如何解决Android上的Twitter API实现
| 我正在开发一个应用程序,在该应用程序中我想实现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);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。