Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Java :: keytool error: java.io.FileNotFoundException: c:UsersUSER_NAMEupload-keystore.jks (The system cannot find the path specified) 
Java :: lambda comparator java 
Java :: how to get last element of array java 
Java :: find min in array java 
Java :: arraylist of arraylist 
Java :: java return tuple 
Java :: Java Queue Array Implementation 
Java :: convert arraylist to csv file java 
Java :: how to check if string is double or not in java 
Java :: set size button java 
Java :: printing 2d array in java 
Java :: check key is pressed java 
Java :: Exception in thread main java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file 
Java :: get request in java 
Java :: How to connect from Android emulator to application on localhost? 
Java :: java remove last character 
Java :: list files in directory java 
Java :: for loop javasctip 
Java :: Array list deep copy 
Java :: Difference between Public, Private and Protected modifier in Java? 
Java :: Java Creating a Vector 
Java :: template competitive programming java 
Java :: datatypes in java 
Java :: how to run individual test in java maven 
Java :: compile java 
Java :: dequeue in java 
Java :: java dimension 
Java :: dot operator java 
Java :: how to set boolean to false if null java 
Java :: inheritance in oop 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =