【安卓必备,HttpUrlConnection】知识养成了思想,思想同时又在融化知识。这篇文章主要讲述安卓必备,HttpUrlConnection相关的知识,希望能为你提供帮助。
package aaa; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; public class aaa {public static void main(String[] args) throws IOException { URL url = new URL("https://123.sogou.com/"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); StringBuilder build = new StringBuilder(); BufferedReader read = new BufferedReader(new InputStreamReader(conn.getInputStream())); String s; while ((s = read.readLine()) != null) { build.append(s + "\n"); } String html=build.toString(); } }
推荐阅读
- [转]查看Android源码版本
- Android 优秀的开源框架整理
- Android 热补丁实践之路
- Android7.0 Ninja编译原理
- 深入Android内存泄露
- Android输入事件从读取到分发五(事件分发前的拦截过程)
- 权限管理二
- 特殊权限
- 理解进程概念—3