1

I am developing an app (for both Android and iPhone). Actually, in my app I have to download lot of videos in background (using a background service, IntentService) as well as I have a screen showing the progress of downloads (using an Activity which has UI for showing download progress). But I don't know why the download speed is too less as compared to download speed for the same app in iPhone.

Also, after each download of video, I am marking that video as downloaded in the database. And this happens for all videos.

Is the database calls a problem for slow downloads of files in android? Since the same functionality does not affect the download speed of files in iPhone.

halfer
  • 19,824
  • 17
  • 99
  • 186
Aqeeb Pathan
  • 33
  • 1
  • 6

2 Answers2

1

Increase the Byte size of your inputstream

Update:
Take a look here

Community
  • 1
  • 1
Maikel Bollemeijer
  • 6,545
  • 5
  • 25
  • 48
1

You could try to implement some sort of download accelerator which downloads a single file by splitting it in segments and using several simultaneous connections to download these segments from a the server. First you should check if the server Accepts byte-ranges and then specify byte-ranges to download in a multi-threaded way. At last you just merge back the segments into a complete file.

Look into these documents for more info:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.5

Page 128: http://www.ietf.org/rfc/rfc2068.txt

Also look up Java API URLConnection.setRequestProperty

However, I think the slow download is mostly because of your network bandwidth and server's upload speed.

Nimooli
  • 89
  • 6