NSUrlSessionConfiguration equivalent android xamarin

Hi,

Anyone know equivalent for NSUrlSessionConfiguration to implement in xamarin.android to implement.

below is code for IOS. can anyone tell me the code for xamarin.android equivalent to it?

using (var sessionConfig = UIDevice.CurrentDevice.CheckSystemVersion(8, 0)
? NSUrlSessionConfiguration.CreateBackgroundSessionConfiguration(Identifier)
: NSUrlSessionConfiguration.BackgroundSessionConfiguration(Identifier))
{
sessionConfig.NetworkServiceType = NSUrlRequestNetworkServiceType.Default;
this.session = NSUrlSession.FromConfiguration(sessionConfig, new UrlSessionDelegate(m_selectedEBook), NSOperationQueue.MainQueue);
}
ThreadPool.QueueUserWorkItem(async(object state) =>
{
using (var url = NSUrl.FromString(downloadURL.PdfDownloadUrl))
{
using (var request = NSUrlRequest.FromUrl(url))
{
downloadTask = session.CreateDownloadTask(request);
downloadTask.Resume();
}
}
}

Tagged:
Sign In or Register to comment.