Hi ,Dave Sparks.
Thanks for your help,Now the solution you give works well.And the problem
has already solved.I find that when I pass the path to the media player,what
I use is like this-setDataSource("/home/huang/sdcard/onelove.mp3"),but not
by setDataSource("/sdcard/onelovemp3");because the emulator has its own file
system,so I use the wrong file path.
Thank you!

On Thu, Dec 18, 2008 at 5:07 PM, Dave Sparks <davidspa...@android.com>wrote:

>
> It seems like you're trying to play the file from your workstation. I
> assume you are testing in the emulator. If so, you need to be aware
> that the emulator has its own file system and it cannot directly
> access your workstation files. Instead, it mounts a file that contains
> an image of a FAT file system. You can create the file with the
> mksdcard tool and then specify the file to use with the -sdcard
> command line option in the emulator.
>
> With the SD card image mounted, you need to push the data file to your
> SD card image like this:
>
> adb push /home/huang/sdcard/onelove.mp3 /sdcard
>
> which copies the file to /sdcard/onelove.mp3. Now you can pass the
> path to the media player by setDataSource("/sdcard/onelovemp3");
>
> On Dec 17, 6:05 am, "hc huang" <chinahhu...@gmail.com> wrote:
> > Hi Girish
> > I want to a audio.I go to this position
> > /development/samples/ApiDemos/src/com/example/android/apis/media/
> > Edit MediaPlayerDemo_Audio.java
> >              path="/home/huang/sdcard/onelove.mp3"
> > then save and re-install,but when I go to apidemos ->media- >mediaplayer
> ->
> > play audio from local file,it doesn't work.No voice .I hope you could
> help
> > me to analysis
> > this problem.Thank you!
> >
> > On Wed, Dec 3, 2008 at 7:27 PM, Girish <htgir...@gmail.com> wrote:
> >
> > > Dear Turk ,
> >
> > > if you just want to play a video on android emulator these are the
> > > steps
> >
> > > go to this location
> > > /development/samples/ApiDemos/src/com/example/android/apis/media/
> > > Edit MediaPlayerDemo_Video.java
> >
> > >                    path = "/sdcard/Yourfilename"; //add your file
> > > name here
> >
> > > Save and quit
> >
> > > run make command .
> >
> > > This will buiild out/target/product/generic/data/app/ApiDemos.apk
> >
> > > Now do adb install out/target/product/generic/data/app/ApiDemos.apk
> >
> > > Now place the videofile (Yourfilename) in /sdcard like this
> > > adb push Yourfilename  /sdcard
> >
> > > Go to apidemos ->media- >mediaplayer -> play video from local file
> >
> > > This should start playing the video which u place in the /sdcard.
> >
> > > Please let me know if you have any other question
> >
> > > Regards
> > > Girish
> >
> > > On Dec 3, 7:58 am, "mrhasandemi...@gmail.com"
> > > <mrhasandemi...@gmail.com> wrote:
> > > > Hi there,
> >
> > > > I am very new to android/programing and would like some help
> > > > please :)
> >
> > > > I have the android SDK running on eclipse and was wondering how to
> > > > create an app that:
> >
> > > > 1. Plays a specific video I want to release (For example; I publish
> > > > the application with a 90 sec video, my app plays it, allows users
> can
> > > > forward, rewind ect.)
> >
> > > > I do NOT want the users to be able to play their videos, just mine :)
> > > > (For the moment, then I wish for users to interact w/ it, but first
> > > > let me make my video play)
> >
> > > > Any help will be very very appreciated, especially commented code; (I
> > > > am a complete noob remember)
> >
> > > > Thank you for your time,
> > > > Kind regards,
> > > > Turk
>
> >
>

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

Reply via email to