1. Are you ready for the Galaxy S20? Here is everything we know so far!


Discussion in 'Android Development' started by plays2, Apr 29, 2012.

  1. plays2

    plays2 Lurker
    Thread Starter

    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

  2. wubbzy

    wubbzy Well-Known Member

    Work with media player

    MediaPlayer | Android Developers

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

    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.

Share This Page