Download Manager, there's a guy who writes well. http://www.trinea.cn/android/android-downloadmanager/
- Download background Notifications
- Download Manager Content Interaction
Recently tidied up the internal business logic
A. Processing the content being downloaded
B. Processing the downloaded content
For download business, user sensitivity to events is divided into:
Class A: Whether to start the download, whether the download is complete
Class B: Download progress, about how long it takes to download
1 downloading is a more time-consuming operation, we will not give a screen to show the download progress, but we still want to give the user prompt.
Android notification is specifically to solve this problem, in the Systemui there is a block area to display the notification, it occupies a small place, in the case of minimizing the interruption of user action to give hints.
Notification bar According to the design, the current display strategy is:
For the download to complete, each download to make a prompt, click on the notification, it can go back to launch the download app
For the download there is a situation that shows the specific progress, there are several downloads showing that there are multiple downloads;
The following strategies are used:
Download the completion notification after clicking back to download Provider Downloadreceiver, launch the downloaded app in the broadcast receiver or send downloadmanager.action_notification_clicked broadcast to the corresponding app.
Download notification Click to go directly to the Download Manager interface
The Download Manager manages a series of downloads, which he organizes and proxies for other individual applications, including download control (pause, continue, end), downloads open, and sometimes users who are more concerned about who the content is.
For these, the user sets the policy when the download is initiated and executes here.
For download control, call the Downloadmanager interface to implement the download, download the content through ContentProvider monitoring update