Institute of Computer Science
  1. Courses
  2. 2018/19 fall
  3. Mobile Application Development (MTAT.03.262)
ET
Log in

Mobile Application Development 2018/19 fall

  • Main
  • Lectures
  • Homeworks & Home Assignments
  • Projects
  • Links
  • Task submission

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

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment