16.2 Android HTTP通信
Android 原生的 HttpURLConnection 工具 在 WebView 中显示,使用loadData(html,"text/html","utf8")方法 ;
16.3 使用“异步任务”
摘自 《Android 并发开发》
16.4 使用 OkHttp进行网络通信
快速入门 http://square.github.io/okhttp/ 托管网页 https://github.com/square/okhttp 在Android的Module的Gradle 脚本中添加依赖 dependencies{ implementation 'com.squareup.okhttp3:okhttp:4.0.1' }
16.5 使用Retrofit进行网络通信
注意Retrofit是基于OkHttp创建的,比OkHttp使用简单一些; 官网 http://square.github.io/retrofit/