I have written a simple audio player on android(below). And trying to run on virtual device(AVD). But I am not getting the sound. Is it not possible to get sound using AVD ?
Kindly help me..
Thanks
package com.example.helloplayer;
import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
public class HelloPlayer extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MediaPlayer mp = new MediaPlayer();
mp.setDataSource("/home/usr/audio/file.mp3");
mp.prepare();
mp.start();
}
}
Hi Please your mp3 file put in your app Raw folder and then used below code