javaAndroid-Programmthe TaskPart 1Topics: Activity, ProgressBars, Services Lectures. A downloader app is to be created.

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

javaAndroid-Programmthe TaskPart 1Topics: Activity, ProgressBars, Services Lectures. A downloader app is to be created.

Post by answerhappygod »

javaAndroid-Programmthe TaskPart 1Topics: Activity, ProgressBars, Services Lectures. A downloader app is to be created. The app should make it possible to enter a URL and download the file hidden behind it. To do this, an activity should be created in which a URL can be entered. After clicking on a download button, the file is downloaded. In addition, the activity should contain a ProgressBar that shows the progress of the download. A service (not an IntentService) should be used to implement the download. On the one hand, this should continue to download the file even if the activity no longer exists, e.g. if the user has left the activity and the app has been deleted from the memory. On the other hand, it must be possible to query the current download progress from the service in order to update the progress bar. If the user returns to the activity, the ProgressBar should be adjusted again according to the current progress. Once the download is complete, the user should die e.g. B. be communicated by a toast. Hints: 1. To test the application, a large file should be used to load the 1. Being able to test leaving and returning to the activity. 2. To implement the download, the classes URL and URLConnection can be used 3. be used. 4. To download the file from the app, the entry <uses-permission android:name="android.permission.INTERNET"/>must be added to the manifest. 5. The DownloadManager may not be used. 6. A service is to be used.
java
Android-Programm
the Task
Part 1
Topics: Activity, ProgressBars, Services Lectures.
A downloader app is to be created. The app should make it possible to enter a URL and download the file hidden behind it.
To do this, an activity should be created in which a URL can be entered. After clicking on a download button, the file is downloaded. In addition, the activity should contain a ProgressBar that shows the progress of the download. A service (not an IntentService) should be used to implement the download. On the one hand, this should continue to download the file even if the activity no longer exists, e.g. if the user has left the activity and the app has been deleted from the memory. On the other hand, it must be possible to query the current download progress from the service in order to update the progress bar. If the user returns to the activity, the ProgressBar should be adjusted again according to the current progress.
Once the download is complete, the user should die e.g. B. be communicated by a toast.
Hints:
1. To test the application, a large file should be used to load the
1. Being able to test leaving and returning to the activity.
2. To implement the download, the classes URL and URLConnection can be used
3. be used.
4. To download the file from the app, the entry <uses-permission android:name="android.permission.INTERNET"/>must be added to the manifest.
5. The DownloadManager may not be used.
6. A service is to be used.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply