I'm upgrading an app to API 23 where org.apache.http is deprecated
来源:互联网 发布:人体工学鼠标 知乎 编辑:程序博客网 时间:2024/06/06 20:29
http://stackoverflow.com/questions/32949626/android-m-org-apache-http-entity-fileentity-deprecated的回答:
If you change your compileSdkVersion to 21, your app will compile cleanly. That being said, there are reasons why Google is backing away from the built-in HttpClient implementation, so you probably should pursue some other library. That “some other library” could be:
the built-in classic Java HttpUrlConnection, though as you have found, its API leaves something to be desiredApache's independent packaging of [HttpClient for Android](https://hc.apache.org/httpcomponents-client-4.3.x/android-port.html)[OkHttp](http://square.github.io/okhttp/) (my recommendation)[AndroidAsync](https://github.com/koush/AndroidAsync)
In particular, OkHttp seems to have a pretty good API for posting a file and posting a multipart form, which should be similar to what your HttpClient code is doing.
0 0
- I'm upgrading an app to API 23 where org.apache.http is deprecated
- SDK6.0 API-23 Unable to find optional library: org.apache.http.legacy
- org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 23 i
- Hive WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated
- Android M 中org.apache.http添加
- 【 HTTP 】---DefaultHttpClient is deprecated
- android 6.0(api 23) SDK, org.apache.http包找不到
- android 6.0(api 23) SDK,没有org.apache.http.包
- mavn 报错Failure to transfer org.apache.maven.shared:maven-shared-components:pom:15 from http://repo.m
- I'm an INTP.
- I'm an INTP.
- I'm an idiot
- Hive警告的解决办法 WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated
- 解决 Android M(6.0) 找不到 org.apache.http.*
- 解决:android:editable is deprecated: Use an <EditText> to make it editable
- The Stuff I'm looking forward to is Coming
- org.apache.http.conn.HttpHostConnectException: Connection to http://localhost refused
- org.apache.commons.cli.BasicParser deprecated
- SQL Server Profiler工具
- 关于iOS中ARC机制的理解
- xxx for cygwin
- 程序运行出现process launch failed: Security
- 高数学习进度
- I'm upgrading an app to API 23 where org.apache.http is deprecated
- Android manifest中actvity下的android:allowTaskReparenting等配置
- java 规则引擎
- ubuntu 源码安装 nginx
- 面向对象编程风格 & 基于对象编程(boost::bind/function)
- Java规则引擎的集成
- 今日主题:nginx反向代理
- 解读分库分表中间件Sharding-JDBC
- UILabel设置文字自动收缩