从 Android 的 Web 服务获取数据
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet();
request.setURI(new URI(address));
HttpResponse response = client.execute(request);
BufferedReader in = new BufferedReader(new
InputStreamReader(response.getEntity().getContent()));
当我检索这样的信息时,bufferedreader 仅包含一长行的整个文本。它不会将中断数据分成行。结果,只有前 3 个 kword 适合该行,其余的都丢失了。我怎样才能避免这个问题?
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet();
request.setURI(new URI(address));
HttpResponse response = client.execute(request);
BufferedReader in = new BufferedReader(new
InputStreamReader(response.getEntity().getContent()));
When I retrieve information like that, bufferedreader in contains only one long line with the whole text. It doesn't divide break data into lines. As a result, only first 3 kwords are fit into the line and the rest is losed. How can I avoid this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
简单地
Simply
你尝试过这个吗?
Have you try this?