Android Tutorial & Lessons 9: Adding sound with MediaPlayer
Uploader Comments (CornboyzAndroid)
Video Responses
All Comments (82)
-
i tried it but it couldnt direct from the splash activity to the "main.xml"....
meaning after the splash activity, an error "the application ___ has stopped unexpectedly. Please try again."... how do you fix it??
-
is it same if i put the "mpSplash.start();" on while loop? and then stop(); it when activity start();
-
hahaha i like your way to teach us..
"hi man, can i listen that?"
it is so simple to understand, nice approach dude..
-
Hey can anyone advice me. i manage to have all the coding right. but when i launch it on the emulator, eclipse say source not found and on the emulator screen was black. what happened?
-
hey dude, one quick question. I've followed everything up until the end of this video and it's all running smoothly except the code we left off with after this video gives me a forceclose. The logo>audio>mymain all starts up followed by a forceclose. any ideas? thanks bro. very informative videos by the way and considering I knew jack about this before today, your videos are helping amazingly.
-
hey man, how to play sound when Menu items are pressed?
What I want to do is after playing the sound when menu list items are pressed, each list items of Menu will open respective activity.
-
so I did everything you did, when you tested the sound before you did the pause, destroy, or resume. Your sound worked, but when I do mine (5 seconds like yours) however it never played. I also tried a 3 minute song with the 5 seconds but I don't hear anything. did my sounds on the emulator get muted? if so, how can i fix that. I got the ringer volume on full so how come my sounds aren't even playing?
-
damn your funny haha! makes java so much funnier. cant imagin my self joking with a mic :O
-
what if i specify launcher for mymenu instead of splash in mainfest.xml is it going to launch mymenu instead of splash need to work on it... health tip alcohol kills
-
i have a question we do have two activities here say splash activity and my menu activity in form of two .java files why is that only splash activity is called first we didnt specified any main method asking copailer to start executing instructions from a point is that mainfest.xmal launcher action does it launching splash activity first. need clarification here travis
i still cant get the splash jpeg to show up, but the sound works great, whats up with that? the splash.xml shows the jpeg just fine in graphical mode....
billybong78 6 months ago
@billybong78 do you have your thread method as "start" or as "run" cause it needs to be, whateverYouCalledYourThread.start()
hope that helps
CornboyzAndroid 6 months ago
hey, I had a 20 second sound to play on the startup, but it didn't play through, in other words the sound seemed to "destroy" itself when it switched to myMenu?? Can you tell me why it did this. I have everything setup the same as you but I had the timer set to 20000 for the 20 sec sound, I then changed it to 1000 to see if the sound would play through to the myMenu, but it would stop playing
MrStewdaddy 6 months ago
@MrStewdaddy hey man, I kind of forgot how we set this up, But I believe we destroyed the mediaplayer sound within the onPause method, or one of those methods. So the reason the music stops is that we called the method whateverYouNameYourSound.release(); which will kill the sound. Hope that makes sense?!?!
CornboyzAndroid 6 months ago
your virtual device is running so fast... how can i make it work fast ?
MuhammadRaza2009 9 months ago
@MuhammadRaza2009 you can start the emulator by going to the window tab>android sdk and avd manager>then click on the emulator you want and press start. then you can programming while it is loading up, and once it is loaded, when you run your application it will start pretty quickly. So basically don't close the emulator, so you won't have to wait for it to load every time you want to test your application.
CornboyzAndroid 9 months ago