Search code examples
javaandroidandroid-download-manager

Android DownloadManager doesn't work in some circumstances


I'm using DownloadManager (Android, Java) to download files over WI-Fi from a machine in the same LAN. It works flawlessly on most of the phones I tested, but it appears that on some devices the download just doesn't start when WAN cable (Internet) is unplugged from the router (!). Everything gets back to normal on these phones when I'll connect the Internet cable. Other phones download the files without issues no matter if the Internet is connected to the router or not. This is puzzling me for over a week. There are no clues in logcat (download just doesn't start without any error). It's very odd as the Internet shouldn't have anything to do with the downloads. Everything is happening in the LAN. Any suggestions are welcome.


Solution

  • As it finally turned out the Fetch library also introduces the same problem. What worked for me, in this case, was crafting my own downloader with AsyncTask and InputStream.