With the release of Android 5.1, it looks like all the Apache http stuff has been deprecated. Looking at the documentation is useless; they all say
This class was deprecated in API level 22.
Please use openConnection() instead. Please visit this webpage for further details.
Which is fine the first time you read it, but when EVERY class that was deprecated says that, it's not that helpful.
Anyway, what are the alternatives for classes like HttpEntity
, specifically StringEntity
, and MultipartEntity
? I substituted BasicNameValuePair
for my own implementation of Android's Pair<T, S>
class, and it looks like URLEncoder.encode
is a good substitute for URLEncodedUtils
, but I'm not sure what to do about HttpEntity
.
EDIT
I've decided just to re-write the networking stuff. Gonna try to use Retrofit and OkHttp
EDIT
Seriously take a look at switching your calls and stuff to Retrofit. Pretty nifty. I'm glad I did. There were a few hurdles, but it's cool.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…