Course Content

Course Content

Creating Music Player in Android

Create Music Player in Android Application


In this video we are going to create Music player in Android application.

For that we need to have one audio, which we will save inside our 'assets' folder in mp3 format.

After that will design its layout, for that which we have taken linearlayout and in it we have three different buttons. One to play, other to pause, and another to stop.

Now to design our main music player we will go to '' file and inside that we have taken one textview 't' and define three buttons. After that we need to create an instance for media player 'mp' and filedescriptor 'sfd'.

Now we will design a code to read the music file which we have stored in our assets folder.

void Source








catch (IOException e)





void play()




void stop()






Now we will design click event for three different buttons, in which we will call the the events which we define for their respective buttons.

After that we will run the code, and see that it is working accurately and the music player starts to play music when used with 'Play' button.


Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
App Store
397K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
13K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere