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. How to code to store data in the default storage in dev phone without using SD card?




2. GeoCoder.getFromLocationName return NULL

hi all,

I used GeoCoder.getFromLocationName for resoved address to GeoPoint,
it will return true in the emulator,but "null" on my machine.

the simple code I post bellow..
is anyboy knows about this issue?

        Geocoder mGeocoder = new Geocoder
        (this, Locale.getDefault());

        List<Address> lstAddress = mGeocoder.getFromLocationName
                           (search_address, 1);
        if (!lstAddress.isEmpty())
          showDialog("not null")
                showDialog("Address's GeoPoint not found,null!!");

3. How to modify the default Android splash screen in source code?

4. Using the internal NumberPicker widget

5. Android 1.6 New OpenCore?

6. about tabhost problem

7. Application Level Object