Well it's a decision solely depending on your user case, imagine you've an API which returns the profile of a user from your DB, formats it and creates a PDF for you. While you can use Volley
for this too, but it's better done with a SystemService
like DownloadManager
which does the download operation completely in background and gives you a callback with the file downloaded.
While there isn't a threshold value as such, but consider it this way, if you wish to Download something, use the DownloadManager
. There are use cases where a DownloadManager
can not be efficient too, imagine you're requesting a JSON from the server and use a DownloadManager
instead of a Volley
request, the paritcular json is fetched completely in background and sent back to you, while this could much efficiently done with volley which gives support for handling different states inside the onErrorResponse
and onResponse
method.
Thus summarising, all the requests which you feel could affect the UI at the present instant and is not more than the average heap memory an application gets during it's runtime (approx. 20-40MB), and needs an instantaneous callback should be done using Volley
. Else for operation which don't affect the present UI much and could be a complete background operation (even if the file size is just 500KB) with not need for an instantaneous callback should be done using DownloadMaanger
Hope this helps.