User User - 4 months ago 15
Android Question

Implement sounds in an android application

I am developing a game application in android. I have designed all the views and implemented all the functionality. Now in the last screen I have to play sounds in android. Can anybody tell me how to pursue with it?

Answer
MediaPlayer mp = MediaPlayer.create(getApplicationContext(), R.raw.AudioFile1);
mp.start();

And then you get all the start/stop/reset/pause/release methods from mp.