ACR HTTP Transfers Plugin for Xamarin and Windows
Cross platform HTTP download/upload manager
SUPPORTED PLATFORMS
- Android 4.3+
- iOS 7+
- .NET 4.5+
- Windows UWP
FEATURES
- Background Uploads & Downloads on each platform
- Supports transfer filtering based on metered connections (iOS & UWP only at the moment)
- Event Based Metrics
- Percentage Complete
- Total Bytes Expected
- Total Bytes Transferred
- Transfer Speed (Bytes Per Second)
- Estimated Completion Time
SETUP
Be sure to install the Plugin.HttpTransferTasks nuget package in all of your main platform projects as well as your core/PCL project
Android
Add the following to your AndroidManifest.xml
<uses-permission android:name="android.permission.WAKE_LOCK"/>
HOW TO USE BASICS
// discover some devices var task = CrossHttpTransfers.Current.Upload("http://somewheretosend.com", "<YOUR LOCAL FILEPATH>"); // when performing downloads, it is necessary to listen to where the temp file lands (this is due to iOS) var task = CrossHttpTransfers.Current.Download("http://somewheretosend.com"); task.PropertyChanged += (sender, args) => { if (task.Status != nameof(IHttpStatus.Task)) return; if (task.Status == TaskStatus.Completed) { task.LocalFilePath // move this file appropriately here } };