• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Help!!!

plays2

Lurker
alright now i might be in the wrong section....but i need some help developing my app. I've made iphone,ipad,and windows phone apps before but now ive decided to begin developing for android also. i'm just looking to create a SIMPLE app, a soundboard. very easy, or so i thought. After searching around the internet for days i've resulted to asking the forums. Ive found little templates and such that work with like, froyo, but i want to make a soundboard for ics using eclipse indigo. How can i link a button up to a sound file, and make it so when you press it once, it plays, and when you press it again, it stops? again i need this to work with the latest version of eclipse. the little templates i found dont work with the lates version of eclipse. idk why/: thanks for the help. If this is the wrong section please tell me where i should post this. im new to the forums (: haha
 
Work with media player

MediaPlayer | Android Developers


do this in onClick of your button:
mp = MediaPlayer.create(Test.this, R.raw.mysound);
mp.start();

you'd also need to put sound file under a directory res/raw. If 'raw' does not exist create it and put the sound file in there.

have fun.
 
Back
Top Bottom