Using Android's DownloadManager for downloads

Using Android's DownloadManager for downloads

Running our app displays a screen with two buttons.

[…]

One receives a broadcast when the download has completed. It checks the status of the download and if successful, starts an activity where the downloaded image is displayed.

The other receives a broadcast when the download notification is clicked.

Click the Start Download button to download an image. On success, it is displayed in another activity

I don't do this but you can if you want to. You can use the Connectivity Manager to check whether there is a current network connection. Then, if you choose, only if there is one will the download proceed.

[…]