How to download a file in Android
Today in this post, I am going to share the code that I use in my android applications to support downloading of file. There are many ways you can use to download a file. For example you can use Async task and read the file stream to save it in device storage, you could also use a Service to download the file. But in my example I will show you the code that uses DownloadManager class.
The code sample using DownloadManager class is as follows:
Now to use this function
The code sample using DownloadManager class is as follows:
Now to use this function
Hope this helps you.downloadFile(context, "http://i.imgur.com/DvpvklR.png", "File download", "File is being downloaded...");
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete