Playing sound in andoird
by
, January 7th, 2012 at 01:04 AM (2574 Views)
Adding sound and music to your app is extremely easy. Place your sound file in a new directory res/raw.
import android.media.MediaPlayer;
and then where you want the music to play:
MediaPlayer myMusic = MediaPlayer.create(this, R.raw.splashsound); myMusic.start();
where splashsound is the sound file's name without the extension.
That's it!