I have moved this post to new website. Visit here.
android, getting started, howto, media player, mediacontroller, music, music shuffle, turorial, tutorial
This entry was posted on September 10, 2011, 8:07 pm and is filed under Technical. You can follow any responses to this entry through RSS 2.0.
You can leave a response, or trackback from your own site.
#1 by savan on September 23, 2011 - 12:37 pm
hey can you send me this whole code with all file…
i got error when i am combining all files….
#2 by Sapan Diwakar on September 23, 2011 - 12:41 pm
You can email me for this.
#3 by savan on September 23, 2011 - 12:54 pm
hey, when i am presing music tab then i got force close error….
#4 by Sapan Diwakar on September 23, 2011 - 1:46 pm
Can you try to debug it using eclipse and see where is the error? I am guessing the you have some problem with initialization of the music player.
#5 by savan on September 23, 2011 - 12:57 pm
i want to play song from my sd card….
#6 by Sapan Diwakar on September 23, 2011 - 1:48 pm
If you are trying to play a song available locally on the SD card, then try using
to set the Data Source.
#7 by Andrew chang on October 7, 2011 - 8:25 am
hi. your code is good. thank you. but, i got force close error. threr is mMediaPlayer.prepareAsync() in initMediaPlayer(). how to fix it?
#8 by Sapan Diwakar on October 8, 2011 - 5:18 am
Could you post the complete stack trace?
#9 by ebtihal on November 25, 2011 - 7:23 am
thank you so much .
I really get interested .
I have quistion
how can I play video from raw folder ??
thank you so much
#10 by Sapan Diwakar on December 3, 2011 - 7:51 pm
I haven’t tried playing videos with Android but I guess it can be done using VideoView.
#11 by Chris Powell on December 8, 2011 - 10:42 pm
Hi There, i’ve pretty much duplicated your code from the source you provided in the downloadable files.
Currently I’m having trouble getting anything to play, Eclipse isn’t reporting any kind of error anyway, i’ve matched up the Android Manifest and String.xml file.
What happens is the program loads fine, etc, I click the play button and nothing happens, it just turns into a pause button them almost immediately turns back into a play button, i changed the url to my file on the internet, which definitely works: http://k002.kiwi6.com/hotlink/08bd3jix81/01_gimme_some_lovin.mp3
I’m at a bit of a loss really, any ideas?
#12 by westsidewill on April 3, 2012 - 2:09 am
Great writeup! I was having issues with implementing song titles and understanding the state diagram of the mediaplayer. I still have to stare at the state diagram really hard to understand what is going on, but this example definitely gave me a good base to work from.
Thanks so much!
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Enter your email address to subscribe to this blog and receive notifications of new posts by email.
Join 21 other followers
Create a free website or blog at WordPress.com.