I have a requirement for my applicaiton which have to download the files in silent mode and some files are in non-silent mode. Silent mode is when application is starting to download the file, the user have no idea the application is downloading. Whereas Non-silent mode, the user will know the file is downloading.
In this case, Non-silent and silent mode can be downloaded simultaneously but each of them can only download one at a time.
I thought of using DownloadManager but not sure whether the DownloadManager will have these type of ability for to control it.
I currently have a RestSharp library to communicate with server. When I researched on google, RestSharp library doesn't seems to have a way of monitor to downloading progress.
Is there other library for xamarin which support monitoring the downloading progress.
The Android OS creates a dedicated thread pool for this purpose and the number of threads created is based on an internally defined resource-based integer so it can be adjusted per API release, device requirements, etc...
Also if you look at the download queue management, it is FIFO-based, so the first X number of Uris that are not failed, paused, disallowed for the current network (wifi, cellular) type, etc.. will be available to downloading.
final int maxConcurrent = Resources.getSystem().getInteger( com.android.internal.R.integer.config_MaxConcurrentDownloadsAllowed);
Thus it is not a fixed number, but to find out how many threads are available for downloading grab the internal integer resource config_MaxConcurrentDownloadsAllowed
:
int id = Resources.getSystem().getIdentifier("config_MaxConcurrentDownloadsAllowed", "integer", "android");
int maxConcurrentDownloadsAllowed = Resources.getSystem().getInteger(id);
var id = Resources.GetIdentifier("config_MaxConcurrentDownloadsAllowed", "integer", "android");
var maxConcurrentDownloadsAllowed = Resources.GetInteger(id);
Personally on most devices that I have run unit-tests against, it is 5, but I seen this as low 1 on the lowest-end Android phone that I ever saw and that cost $5 ;-) and on a custom-built CDN-style Android server it was 50