Music player on android emulator

Music player on android emulator

I want to play music on android emulator. I have pushed mp3 file on emulator using DDMS file explorer. I started music player on emulator, but mp3 file is not detected by player. Can I play music on emulator?
Thnaks,
Kishor

12 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

You can download Android Emulatoe for mobile or PC.You can download below link...

http://www.addictivetips.com/windows-tips/download-google-android-emulator/

Best Reply

play music in android emulator

  1. goto Window->AVD Manager-> (select AVD)->Edit (in Right panel) ->New (in Hardware) ->SD Card support ->Edit AVD
  2. Through DDMS put mp3 in a folder(if not create) in sdcard oflder of mnt folder
  3. relaunch your AVD and play mp3 file
Esprit Mobile

Hi

You can should simply push the mp3 file into the emulator with adb, and open it directly on the emulator, and ENJOY !

Google it and your life will be more easier ;)

To play .mp3 file from sdcard of the emulator follow the steps.

  1. Copy .mp3 file from your hard drive location. e.g. d:\songs\song1.mp3
  2. Open any new eclipse project. File -> New -> Android Project.
  3. In Eclipse Click on the icon “Opens the Android SDK and AVD Manger” from the toolbar.
  4. Create New AVD, by choosing, select target greater than 1.6.
  5. Upon successful creation start the AVD.
  6. In Eclipse, Goto DDMS perspective. Window -> Open Perspective -> DDMS.
  7. In DDMS Perspective, select the device (AVD) which is currently running from the Devices Panel.
  8. On the right panel from “File Explorer”, Select SDCARD folder.
  9. On the tool bar select the button “Push a file on to the device”.
  10. Select the .mp3 file from the location.
  11. Goto Java Perspective. Window-> Open Perspective -> JAVA.
  12. Write the following Code.

String PATH_TO_FILE = “/sdcard/a.mp3″;
MediaPlayer mp1 = new MediaPlayer();
try

       {
mp1.setDataSource(PATH_TO_FILE);
mp1.prepare();
mp1.start();
}       catch (IllegalArgumentException e)      {
// TODO Auto-generated catch block
e.printStackTrace();
}      catch (IllegalStateException e)      {
// TODO Auto-generated catch block
e.printStackTrace();
}      catch (IOException e)      {
// TODO Auto-generated catch block
e.printStackTrace();
}

That's all :)

You should try another player , but i dont think android emulator was meant to play music with.

DEMACIAAAAA!

You can simply push the mp3 file into the emulator with adb, and open it directly on the emulator

have u run the media scanner...in devtools...?

main menu->devtools->mediascanner

check the file path in program code...

Hi, you would to use vwware or virtualbox for emulate android.

JudLup Luna

Leave a Comment

Please sign in to add a comment. Not a member? Join today