MediaStore.Audio

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


Sponsored Links
 Hello,

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
internet.

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,
Gabriel

--



MediaStore.Audio

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
rows)
            null,       // WHERE clause selection arguments (none)
            null); // Order-by clause (ascending by name)
    int column_index =
cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
    cursor.moveToFirst();

    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
file?

Tnx



>


Sponsored Links


MediaStore.Audio

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 <gsim...@gmail.com>


> >



MediaStore.Audio

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. Destroy Android Thread

Hi,

I did quite a simple app using android thread to implement progress
dialog. The app work this way :
When we click on button, it will start separate thread and analyze
something on the thread while keep updating the progress dialog. It
was running fine till the thread finished.

But after finished, when I click on the button again, it should
analyze again, but what happen was it show progress dialog already at
100% and stuck there, instead of reanalyze and start progress dialog
at 0%.

I am wondering that this is caused by prev thread that still on
memory. How we destroy that thread? I did assign null to the thread
before start new one. Some thing like this :

public onclick(){
analyzeThread = null;
analyzeTrhead.start();
}

Hope anybody could advice.

-- 

2. Set Default Chooser when Selecting Image?

Hello,

In my application the user selects an image. When the
ACTION_GET_CONTENT intent is launched it displays the dialog to select
one of the available image viewers installed on the device. However I
need the built in Gallery app to be chosen because upon selecting an
image it launches the screen to crop the image (same thing that comes
up when choosing the home screen wallpaper) which only the Gallery
chooser offers.

Is it possible to skip this chooser dialog and launch the Gallery
automatically? Or at least remove the other options from the list so
only Gallery displays?

Thank you!

Matt.

-- 

3. Some Red Flags for Android on Verizon

4. "installation unsuccessful" errors in market

5. Android cloud to device

6. Is it possible to format individual row items of a list on Selection?

7. how to make sliding tabs like app brain market android app