Homework 3
Background services
Start a service to play music in the background.
- The single activity of the application should have a button, pressing it will launch a background service (2 pts)
- The background service starts playing music when started ( 1 pts)
- Pressing the button again if the service is already playing music, the music should stop or pause. ( 1 pt)
- Use SharedPreferences to display a counter how many times the user has started playing music (1 pt)
Pressing the back button or home button should not stop the music!
To include a static file with your app, put it in your projects res/raw/<filename>, then you can open it with openRawResource(), passing the R.raw.<filename> resource ID