I am new in android programming,
I want to play a beep sound when clicking on a button.
I have onClickListener in my application which do something, I want to play a beep when button is clicked!
How to play a beep sound when touching a button?
layout.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
if(C=="1") { C="2"; s2=s2+ex;}
else { C="1"; s1=s1+ex;}
}
});
how to do that with detailes like where to copy my beep.mp3 or beep.wav sound and codes and …
thanks.
A very good tutorial
http://www.vogella.com/articles/AndroidMedia/article.html
Also, next time, please consider Google.
https://www.google.com/search?q=play+sound+android
This tutorial is the second result.
another good one: http://java.dzone.com/articles/playing-sounds-android