Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

play mp3 android java

MediaPlayer mediaPlayer;
//In the onCreate Method
mediaPlayer = MediaPlayer.create(this, R.raw.alarmclockbuzzer);
//Sound file goes in "raw" folder in "res" folder
mediaPlayer.start(); //plays the mp3 sound (doesn't need to be in oncreate)
 
PREVIOUS NEXT
Tagged: #play #android #java
ADD COMMENT
Topic
Name
7+6 =