I have the following code for Android which works fine to play a sound once a button is clicked:
Button SoundButton2 = (Button)findViewById(R.id.sound2);
import android.view.MotionEvent;