Category Archives: android-download-manager

Configure Apache/nginx to let DowloadManager downloads be resumable

My Android app has to download big files (typically 30-300 MB, sometimes 700 MB or even more). The files can be served by Apache httpd 2.2 or nginx 1.2 (I can choose the best option).

Currently it seams like all downloads start from the beginning after a failure.

Web-Server

Do I have to configure or add plugins/extensions so that in case of network failure or other interruptions, the download can be resumed by the client? AFAIK the http-header Range has to be supported. Maybe other headers have to be set to let resume work?

I mean, especially when downloading lets say 500 MB with the device loosing network connectivity after 480 MB successfully downloaded, it should not begin downloading the file starting at offset 0.

Android DownloadManager

Are there any tweaks (Request options) so the DownloadManager doesn't start from 0? Would it be better to split large files into smaller chunks and concat them after download?

Configure Apache/nginx to let DowloadManager downloads be resumable

My Android app has to download big files (typically 30-300 MB, sometimes 700 MB or even more). The files can be served by Apache httpd 2.2 or nginx 1.2 (I can choose the best option).

Currently it seams like all downloads start from the beginning after a failure.

Web-Server

Do I have to configure or add plugins/extensions so that in case of network failure or other interruptions, the download can be resumed by the client? AFAIK the http-header Range has to be supported. Maybe other headers have to be set to let resume work?

I mean, especially when downloading lets say 500 MB with the device loosing network connectivity after 480 MB successfully downloaded, it should not begin downloading the file starting at offset 0.

Android DownloadManager

Are there any tweaks (Request options) so the DownloadManager doesn't start from 0? Would it be better to split large files into smaller chunks and concat them after download?

Compiling Google Download Library targing API 23 Android Marshmallow

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;