I'm using Google's Download library for expansion pack downloading as distributed through the 'Android SDK' manager. Building using Eclipse/Ant since haven't migrated to AS/Gradle yet - but any solution would help.
In API 23 Apache HTTP goes away. And I already implemented a workaround to get Google's LVL to compile. (Lvl library and android marshmallow)
But the download library is substantially larger beast to tackle and not sure I really want to fix Google's code - probably just write my own instead if necessary.
Does anyone know of a convenient "drop in" (-ish) replacement library or suitable workaround?
~~
Compile errors for unavailable imports in 'com.google.android.vending.expansion.downloader.impl.AndroidHttpClient'
import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpEntityEnclosingRequest; import org.apache.http.HttpException; import org.apache.http.HttpHost; import org.apache.http.HttpRequest; import org.apache.http.HttpRequestInterceptor; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.ResponseHandler; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.params.HttpClientParams; import org.apache.http.client.protocol.ClientContext; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.conn.scheme.PlainSocketFactory; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; import org.apache.http.conn.scheme.SocketFactory; import org.apache.http.conn.ssl.SSLSocketFactory; import org.apache.http.entity.AbstractHttpEntity; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.impl.client.RequestWrapper; import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager; import org.apache.http.params.BasicHttpParams; import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpParams; import org.apache.http.params.HttpProtocolParams; import org.apache.http.protocol.BasicHttpContext; import org.apache.http.protocol.BasicHttpProcessor; import org.apache.http.protocol.HttpContext;
Edit:
NOTE: As of Oct 26, 2015, SMarek's library above doesn't quite build successfully as-is
Meanwhile, it turns out there is an "easier" drop-in solution for Ant users in lieu of the "usesLibrary org.apache.http.legacy" option for gradle users.
SDK/platforms/android-23/optional/org.apache.http.legacy.jar
into application's ./libs directoryThen add the following to proguard
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.**
-dontwarn android.net.**
NOTE: The android.net 'dontwarn' will mask OpenSSL calls ("android.net.http.SslCertificate"). In my case it arises from WebKit which I'm not using (although 3rd party libs might)
Unfortunately, it pushed my app over the 65k limit. Never a dull moment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With