1. Download our Official Android App: Forums for Android!

Apps Help!!!

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

  1. plays2

    plays2 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Apr 29, 2012

    Apr 29, 2012
    1
    0
    5
    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
     

    Advertisement

  2. wubbzy

    wubbzy Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    109
    Joined:
    Dec 19, 2011

    Dec 19, 2011
    109
    32
    63
    *nix kernel's by day
    Silicon Valley
    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.
     

Share This Page

Loading...