You can play some music in the background of your app using the MediaPlayer
class. Here is some sample code to show how simple this can be:
// Create a MediaPlayer object MediaPlayer mp = new MediaPlayer(); // Choose where to load the music from mp.setDataSource(musicFileToLoad); // Call the prepare method mp.prepare(); // Play some music mp.start();
Take a look at the official documentation for full details at http://developer.android.com/reference/android/media/MediaPlayer.html.
This is also made easy for us by Android. On the Android Studio palette, you can drag a MediaController widget, which not only allows your user to control music playback but video as well. Find out how to use this widget on the Android developer site, http://developer.android.com/reference/android/widget/MediaController.html.
18.223.172.224