android 连接CMWAP

阅读更多
URL url = new URL("http://10.0.0.172/img/baidu_logo.gif"); 
HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
conn.setRequestProperty("X-Online-Host", "www.baidu.com"); 
conn.setDoInput(true); 
conn.connect(); 
InputStream is = conn.getInputStream(); 
bitmap = BitmapFactory.decodeStream(is); 
is.close(); 
conn.disconnect(); 

 

你可能感兴趣的:(Android)