0

I am facing a problem where a user is downloading a large file (roughly 1.5GB) and if the connection dropped, the user needs to restart downloading from beginning.

What can I do in Xamarin Android C# to implement resume download? The file will be hosted on Amazon S3.

Any help will be fantastic!

Thank you!

WorldWind
  • 311
  • 1
  • 5
  • 17

1 Answers1

2

Use DownloadManager - it

will conduct the download in the background, taking care of HTTP interactions and retrying downloads after failures or across connectivity changes and system reboots.

var manager = DownloadManager.FromContext(this); 
var request = new DownloadManager.Request(Uri.Parse(uri));
long downloadId = manager.Enqueue(request);
Andrii Omelchenko
  • 13,183
  • 12
  • 43
  • 79
  • Sorry, but I'm looking for solution within application. I want to visually show status as part of the interface. Any suggestion on what I can do to have similar functionality as download manager but inside my application? Thanks! – WorldWind Apr 30 '19 at 04:58
  • @WorldWind You can use [this](https://stackoverflow.com/a/8002259/6950238) approach to get information about start/resume/progress. – Andrii Omelchenko Apr 30 '19 at 09:22