APK Downloader
·8 min read

Resuming an Interrupted APK Download: HTTP Range, Mobile Dropouts, and Verification

An APK download that dies at 80% is a server-and-client negotiation problem, not bad luck. Learn how HTTP Range and If-Range work, why Android kills downloads, how to resume with curl -C -, and how to verify a stitched file before installing.

androidapkdownloadhttpgptoapk

You are 150 MB into a 200 MB APK. You take a call, switch back, and the progress bar is at zero. You restart it, and it dies at the same byte again.

Resuming is not a client-side feature you can switch on. It is a negotiation: the server must support byte ranges, and the client must actually use them. If either side is missing, the only path forward is starting over — which is fine, as long as you know that's what you're doing.

The mechanism: HTTP Range

A normal download says "send me everything." A resumed download says "start at byte N":

GET /app-release.apk HTTP/1.1
Host: example.com
Range: bytes=157286400-

A server that supports it answers:

HTTP/1.1 206 Partial Content
Content-Range: bytes 157286400-209715199/209715200
Content-Length: 52428800

Three conditions must all hold:

  1. Status is 206, not 200. A 200 means "I ignored your range and I'm sending the whole file" — which is correct if the file changed underneath you.
  2. Content-Range is present and its total size matches what you already have on disk.
  3. The file is the same version. Downloaders should send If-Range with the validator they saw originally:
If-Range: "a3f5c9e2-19d8b1c"
Range: bytes=157286400-

If the build was replaced in the meantime, the server correctly falls back to a full 200. Accept that. Splicing a fresh header onto an old tail produces a corrupt APK — and a corrupt APK that still installs is worse than one that doesn't.

Test any URL in one command

curl -sI -H "Range: bytes=0-1023" https://example.com/app-release.apk | head -5

206 Partial Content means resumable. 200 OK with the full Content-Length means it is not; use a segmented downloader or switch networks and accept a full restart.

Why Android kills large downloads

APKs are big and slow, which puts them directly on top of several Android defaults:

CauseSymptomFix
Process frozen in backgroundProgress resets after a callKeep downloader foregrounded, allow background activity
Battery optimisation cuts networkStalls when screen is offSet downloader to "Unrestricted"
Wi-Fi ↔ cellular handoffConnection resets mid-transferDisable "switch to mobile data" assistants
Proxy or VPN dropoutStalls at the same percentageAvoid sharded proxies; use a stable route
Low storageDownload completes, write failsFree 2× the APK size
Server rate limitingFast start, slow tail, timeoutWait minutes, don't hammer retry

The most diagnostic symptom is "retries die at the same byte." That means everything before the breakpoint is reachable and the problem is near the tail — usually an edge-cache miss on that slice, or an aggressive upstream timeout. Change the source; more retries won't help.

Where to grant background permission

  • Stock / near-AOSP: Settings → Apps → Downloader → Battery → Unrestricted
  • MIUI / HyperOS: Apps → Manage apps → Downloader → Battery saver → No restrictions
  • ColorOS / OriginOS: Battery → App battery management → Allow background activity
  • One UI: Battery → Background usage limits → remove from "Sleeping apps"

Then test properly: lock the phone for ten minutes and check whether the progress moved.

Three ways to actually resume

1. Use a downloader that honours Range

ADM, IDM-class apps, and most built-in browser downloaders all support it. The only test that matters: after an interruption, does "Retry" continue from the breakpoint or restart at 0%?

  • Download from a direct file URL, not a redirect page or a signed link with a short-lived token. Expired tokens turn a resume into a 403.
  • Never clear browser cache or the download task while a transfer is incomplete.
  • After reconnecting, wait 10–30 seconds before retrying so you don't hit a rate limiter.

2. Refresh and restart the task (for expired links)

When the URL itself has expired, "Resume" is meaningless — the task points at a dead address. Go back to the page, click download again, and delete the stale task. Delete-then-redownload is cleaner than trying to revive a task with a replaced URL.

3. Resumable download on a computer, then copy to the phone

# -C - resumes from the current end of file; safe to run repeatedly
curl -L -C - -o app-release.apk "https://example.com/app-release.apk"

# wget equivalent
wget -c "https://example.com/app-release.apk"

curl -C - is idempotent: after any disconnect, run it again and it computes the offset itself. Keep -L, or a 302 will end the transfer.

When a single connection is unstable but the server supports ranges, fetch slices in parallel:

SIZE=$(curl -sI "https://example.com/app-release.apk" | awk '/Content-Length/{print $2}' | tr -d '\r')
for i in $(seq 0 7); do
  START=$(( SIZE / 8 * i ))
  END=$(( SIZE / 8 * (i+1) - 1 ))
  [ $i -eq 7 ] && END=$(( SIZE - 1 ))
  curl -s -r ${START}-${END} -o part.$i "https://example.com/app-release.apk" &
done
wait
cat part.* > app-release.apk

Segmented downloads are where corruption actually happens. Verify before installing.

Verify the stitched file — always

  1. Size matches the advertised byte count exactly. A few hundred bytes short means the last chunk never landed.
  2. Hash, if the site publishes SHA-256:
shasum -a 256 app-release.apk      # macOS
sha256sum app-release.apk          # Linux
  1. Archive integrity: unzip -t app-release.apk validates the ZIP central directory. An APK is a ZIP; a broken directory is exactly what "There was a problem parsing the package" reports.

If any check fails, the only correct action is a full re-download. Particularly for banking, payment, and messaging apps, a single bad byte from a spliced file is enough to make the package untrustworthy.

Decision shortcut

  • Server answers 206 → use a resumable downloader; the breakpoint reconnects on its own.
  • Server answers 200 → resume is impossible; loop curl -C - or segment-and-verify.
  • Dies at the same percentage every time → change source.
  • Completes but won't install → run unzip -t and the hash before assuming the build is broken.

For failures that happen before the transfer starts — 403, 404, expired signed URLs — see APK download 403, 404, and mid-transfer failures, or grab packages directly from the gptoapk APK downloader.