
操作步骤:
<1>
生成请求对象
HttpGet httpGet = new HttpGet("请求地址。。。。。");
<2>
生成客户端对象
HttpClient httpClient = new DefaultHttpClient();
<3>
执行请求
HttpResponse httpResponse = httpClient.execute(httpGet);
<4>
接受响应
HttpEntity httpEntity = httpResponse.getEntity();
<5>得到数据流
InputStream inputStream = httpEntity.getContent();
注意:
要添加权限: <uses-permission android:name="android.permission.INTERNET" />
具体实现:
posted on 2012-03-23 17:54
mixer-a 阅读(773)
评论(0) 编辑 收藏