Download the New LearnVern Android App and enter Lucky Draw to win Free Certificate
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 'musicplayer.java' 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.
catch (IOException e)
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.
Have a friend to whom you would want to share this course?