I'm working on a fairly simple web based app.  Basic functionality is
push a button and hear a sound.  It's all done in HTML and JavaScript
and then built using Phonegap Build.  It works perfectly in Android's
browser.  But when packaged into an APK and installed on the phone,
the sounds don't play.

I'm still fairly new to Android development, so I'm just looking for
some direction.  I downloaded a logcat viewer, found where the mp3
files are being loaded up, but nothing stands out as an error or
problem.  Here's the basic JS code that should play the sound.

var sounds = new Array();
                        sounds[0] = "0.mp3";
                        sounds[1] = "1.mp3";
                        sounds[2] = "2.mp3";
                        sounds[3] = "3.mp3";

                        function PlaySound() {
                                randNum = Math.floor(Math.random()*4);
                                var sound = new Audio(sounds[randNum]);
                                sound.play();
                        }

The PlaySound function is called when the button is tapped.  I've done
console logs to ensure the function is called properly.

Not sure the best method to go about debugging this.  Any help would
be great.

Thanks,

Justin

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to