一、基于TCP的网络通信
Socket
二、使用URL访问网络资源
1. 使用URL 读取网络资源
URL url = new URL(String url);
// 打开该URL对应的资源的输入流
InputStream is = url.openStream();
// 从输入流解析出图片
Bitmap bitmap = BitmapFactory.decodeStream(is);
2. 使用URLConnection提交请求
URLConnection conn = url.openConnection();