How to create a MusicPlayer for Android Device

0 8,215

Create a MusicPlayer for Android

Today I will describe you how easily you can create a MusicPlayer for Android device. Now there is a number of MusicPlayer Apps for Android available in the market. The Android itself provides services for managing media Playback that the Apps require for creating an interface between the user and music files.

We are going to create a simple Music Player for Android that will read selected Audio file from the list presented by the App. You can have basic controls like Play, Pause, Previous, Next and Seek in this App.

Follow the steps

Before following these steps you must have installed JDK 7.0 or above and Android 2.0 on your device or PC.

  • Create a New Project in Android Studio and name it .
  • The minimum API level should be set to 17 so that it can run most of the Android device in Playstore.
  • Click on Blank Activity and name your layout xml as activity_main and press finish.

Write the following code inside activity_main.xml.

Create a new resource file item.xml inside layout folder and write the following code in it.

Write the following code inside manifest.xml.

The next step is to create a new class and name it as MediaCursorAdapter.java. Add the given code in the following class.

Write the code given below inside MainActivity.java.

Comments

comments

Leave A Reply

Your email address will not be published.