Thursday, March 3, 2011

[android-developers] Re: How to find/associate audio files to my events

Thanks for moving me along... This worked.

---------------------------------
File list_path;
if (status.equals(Environment.MEDIA_MOUNTED))
list_path = new File("/sdcard");
else
list_path = new File("/data/sec_media");
File f_list[] = list_path.listFiles();
File file=f_list[1];
Uri base = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
Uri myBase= base.fromFile(file);
MediaPlayer up = MediaPlayer.create(this,myBase);
up.seekTo(0);
up.start();
--------------------------------


On Mar 3, 8:12 pm, cellurl <gpscru...@gmail.com> wrote:
> yes, the file shows up as /sdcard/file.mp3
>
> Q: How do I play it?
>
> On Mar 3, 12:16 pm, Marcin Orlowski <webnet.andr...@gmail.com> wrote:
>
>
>
>
>
>
>
> > On 3 March 2011 19:11, cellurl <gpscru...@gmail.com> wrote:
>
> > > I tried this post. It finds the SD card in my emulator, but it is
> > > empty.
>
> > Did you put any files on emulated SD card?
>
> > --
> > Regards,
> > Marcin

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate