public static Bitmap getBitmapFromServer(String imagePath) {HttpGet get = new HttpGet(imagePath);HttpClient client = new DefaultHttpClient();Bitmap pic = null;try {HttpResponse response = client.execute(get);HttpEntity entity = response.getEntity();InputStream is = entity.getContent();pic = BitmapFactory.decodeStream(is);   // 关键是这句代码} catch (ClientProtocolException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();}return pic;}

其中imagePath是你的图片路径,比如:http://localhost:8080/app/images/abc.jpg

最后可以将图片显示在手机上:

imageView.setImageBitmap(bitmap);


更多相关文章

  1. Android知识点
  2. android 网络访问-图片处理优秀开源项目
  3. Ubuntu eclipse下android virtual device manager不能删除AVD
  4. Android修改Eclipse 中的Default debug keystore路径,以及修改and
  5. android布局的一些知识
  6. 浅谈android的selector,背景选择器 .
  7. Windows如何配置Android的ADB环境变量
  8. Android(安卓)Step by Step (1)——第一个Android程序"Helllo An
  9. Mono For Android(安卓)之 配置环境

随机推荐

  1. Android(安卓)Studio配置SVN
  2. Android(安卓)访问权限设置
  3. android edittext 边框 源码实现
  4. Android——扩大ImageButton的点击区域
  5. android 属性系统 及其 补充
  6. Android(安卓)Bluetooth 移植(上)
  7. android的网络编程
  8. 初学者----Android(安卓)自定义View,进度
  9. Android的线程使用来更新UI----Thread、H
  10. Android基础入门教程——2.2.1 LinearLay