2
votes

Is there a way to download single big file as multiple thread and combine all once downloaded from google cloud storage.

2
Yep, Brandon's answer below should get you started. It's worth noting, however, that maxing out the phone's connectivity could be a bit rough on the battery, and might degrade performance of other applications if you're doing it in a background task. Network bandwidth in general costs users a lot of battery (and possibly money) so you might want to tread lightly. - Benson

2 Answers

2
votes

Yes. When downloading objects from Google Cloud storage, you can specify a byte range that you would like to retrieve. Using the XML API, this would be handled via the "Range:" header. This is useful for resuming interrupted downloads, but it can also be used to download the file with multiple threads.

Here's some documentation on how to format the range parameter: https://developers.google.com/storage/docs/reference-headers#range

And here's the documentation for the get object call, including the Range header: https://developers.google.com/storage/docs/reference-methods#getobject

1
votes

you can use android's DownloadManager class, its best for downloading files with larger sizes please see link below http://developer.android.com/reference/android/app/DownloadManager.html