Question: Please could anyone help me with this android programming. I just need the java code 1. Create a Service to download the MP3 provided This

Please could anyone help me with this android programming. I just need the java code

1. Create a Service to download the MP3 provided This MUST extend IntentService

MP3 should be downloaded when the Download option is clicked you may use either DownloadService or DownloadManager

2. Create another Service to handle playback of your newly downloaded song

This should extend Service This MUST run the MediaPlayer itself inside of a Service

The buttons in your Activity should make requests to the Service to play/stop/pause/etc

the state of the MediaPlayer should not change when the user presses the back key or home key that is, if the MediaPlayer is playing music, leaving the Activity should not stop the music

3. Manage Notifications for the following events

1. download of the MP3 has started download of the MP3 has completed

2. when the user clicks on this notification clear the notification launch your MediaPlayer Activity (hint: PendingIntent)

the song is playing you shouldnt allow this notification to be cleared

3. the notification should go away when playback is stopped or paused

4. when the user clicks on this notification launch your MediaPlayer Activity

THINGS TO NOTE

Your Activity should not actually play the music itself, thats what your Service is for. Clicking on the playback Buttons from within your Activity should make calls to the Service, and the Service should take the appropriate action. This prevents playback from being stopped when your Activity loses focus Do not place the MP3 inside of your res/raw directory. Youre supposed to download it, then get the URI after the download, and use the URI to launch the MediaPlayer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!