3

I want to download a list of potentially hundreds of images to the SD card while the user waits. I would like to get the maximum throughput but still be a responsible app. I'll be saving the downloaded data as it fills the InputStream as in this answer.

What considerations should I keep in mind? Is there a limit on the number of InputStreams? Will adding more concurrency make more or less effective use of radio power (most of the data is downstream)?

Community
  • 1
  • 1
Jeff Axelrod
  • 27,676
  • 31
  • 147
  • 246

2 Answers2

1

I suspect the best way to approach this is going to be to measure your throughput at run-time and adjust the number of concurrent downloads to get the highest throughput.

Different network connection types (wifi, lte, 3g etc) on different providers in different locations will determine how many connections is optimal.

So I would start with one connection, measure its throughput, then create another connection and measure again. If you are getting more throughput keep adding connections until you see a drop off.

Rob
  • 4,733
  • 3
  • 32
  • 29
1

Take a look at some of the articles on the AT&T site about how to be efficient when writing an app that uses the network a lot. http://developer.att.com/developer/forward.jsp?passedItemId=7200042

Their ARO tool will also help you to ensure that your application makes efficient use of the network and both app performance and battery usage is minimized. http://developer.att.com/developer/legalAgreementPage.jsp?passedItemId=9700312

The recently released Android traceview tool that comes with the Android SDK will also help you http://developer.android.com/tools/debugging/debugging-tracing.html

Rod Burns
  • 2,104
  • 13
  • 24