by Gabriel Sim玫es » Wed, 05 May 2010 09:46:33 GMT

Sponsored Links

Ive been trying to understand how to get data about all the audio
files in the device using MediaAudio but unfortunately the
documentation is far from clear. Also, theres almost nothing about it
on the forum right now and I couldnt find good resources over the

Ive seen pretty quick and objective examples on how to access the
main information from the containers but I couldnt find in any place
how I could get the names of the tracks (MediaStore.Audio.AudioColumns
doesnt have  an specific constant for it) and the most important, how
I could retrieve the path for the media (audio file in this case) Ive
found using the info on MusicStore.Audio.

am I missing something here? It seems it should be so easy but I cant
find the info!

Also ... if I change any data on the container, will this data be also
changed in the real file as well?

Thanks for your help,



by Gabriel Sim玫es » Wed, 05 May 2010 09:51:59 GMT

 Ive found a snipplet for MediaStore.Images that I think will work for
audio also,

public String getRealPathFromURI(Uri contentUri) {

    // can post image
    String [] proj={MediaStore.Images.Media.DATA};
    Cursor cursor = managedQuery( contentUri,
            proj, // Which columns to return
            null,       // WHERE clause; which rows to return (all
            null,       // WHERE clause selection arguments (none)
            null); // Order-by clause (ascending by name)
    int column_index =

    return cursor.getString(column_index);

This way Im left with two questions:

How can I get the name of the track?
Will any changes to the container also change the data in the real



Sponsored Links


by Second Dancer » Thu, 06 May 2010 09:57:29 GMT

 Hi Gabriel
I'm not quite sure whether the data in the real file changes when changes
occurs in the database, i only has done some querying operation. If you
wanna to see the details about the media file, you may see into the
external-xxx.db file

2010/5/5 Gabriel Simes <>

> >


by Gabriel Sim玫es » Mon, 10 May 2010 05:21:32 GMT

 Thanks for your reply!

Will try some code and post the results then!

> > >

Other Threads

1. [wta] setelah di inject knp masih sinyal 1x??

sore suhu2 android..
mau nanya kenapa droid ane setelah di inject smart kok dapet sinyal 1x aja
di pancing juga muncul 3g setelah beberapa detik kok balik lagi ke 1x...
mohon bimbingan suhu-suhu agar droid ane bisa merasakan ganasnya kecepatan
3g smart...

thx before,,,


2. Fetch data from android service to HTML


I have developed one UPNP server application which is running
perfectly in android emulator. I am able to fetch the data from the
server to client in android. But how can I get the same data in a
normal HTML page. Means I want to develop an HTML with javascript that
fetch the content from android server application. Please guide me how
can I achieve this.



3. Voice Recording : OpenCore OSCL Scheduler

4. Ginger bread - NFC Card Emulation & p2p

5. Focus and raise keyboard for Dialog with EditText

6. Server Response

7. Multicast Support