80,475
社区成员
发帖
与我相关
我的任务
分享
能附上代码么[/quote]
这个是服务器那边的配置,不需要代码的。如果服务器是windows操作系统,要安装IIS服务;Linux操作系统的话装个apache配置好了把httpd启动就可以了。
能附上代码么
ImageView imgView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imgView = (ImageView) findViewById(R.id.imgView);
imgView.setImageBitmap(getBitMap("http://XXXX.com/your.jpg"));
}
public Bitmap getBitMap(String imgUrl) {
URL urlImg = null;
Bitmap bmp = null;
try {
urlImg = new URL(imgUrl);
} catch (MalformedURLException e) {
e.printStackTrace();
}
try {
HttpURLConnection conn = (HttpURLConnection) urlImg
.openConnection();
conn.setDoInput(true);
conn.connect();
InputStream is = conn.getInputStream();
bmp = BitmapFactory.decodeStream(is);
is.close();
} catch (IOException e) {
}
return bmp;
}
能附上代码么[/quote]
这个是服务器那边的配置,不需要代码的。如果服务器是windows操作系统,要安装IIS服务;Linux操作系统的话装个apache配置好了把httpd启动就可以了。[/quote]
可以给个FTPClient的思路么