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
Music player on android emulator
Music player on android emulator
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
You can download Android Emulatoe for mobile or PC.You can download below link...
http://www.addictivetips.com/windows-tips/download-google-android-emulator/
play music in android emulator
- goto Window->AVD Manager-> (select AVD)->Edit (in Right panel) ->New (in Hardware) ->SD Card support ->Edit AVD
- Through DDMS put mp3 in a folder(if not create) in sdcard oflder of mnt folder
- relaunch your AVD and play mp3 file
hello
you can try this tuto
http://android-er.blogspot.com/2009/10/create-sd-card-in-android-emulator-and.html
Esprit Mobile
Hi kishordesai,
Check this tutorial : http://mobilecomputing650003.wordpress.com/2011/09/17/how-to-play-mp3-file-in-a-android-emulator/
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.
- Copy .mp3 file from your hard drive location. e.g. d:\songs\song1.mp3
- Open any new eclipse project. File -> New -> Android Project.
- In Eclipse Click on the icon “Opens the Android SDK and AVD Manger” from the toolbar.
- Create New AVD, by choosing, select target greater than 1.6.
- Upon successful creation start the AVD.
- In Eclipse, Goto DDMS perspective. Window -> Open Perspective -> DDMS.
- In DDMS Perspective, select the device (AVD) which is currently running from the Devices Panel.
- On the right panel from “File Explorer”, Select SDCARD folder.
- On the tool bar select the button “Push a file on to the device”.
- Select the .mp3 file from the location.
- Goto Java Perspective. Window-> Open Perspective -> JAVA.
- 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



