Query the android Mediastore for Artist names of Music files -


I'm tearing about implementing it because content provider URI queries do not support SQL "DISTINCT" query method Returning the cursor to the artist of the song in Mediastore, removing any duplicate entries.

I can ask and can get the cursor all the artists, or just do not show them.

I have tried to use a matrix cursor to create a new cursor with cheat entries, but it is slow (create an array of artists, if do not copy it into the new matrix casserator , Etc.)

Can someone recommend a better solution, or can I tell me in the right direction ??

I have also thought about pre-loading information in which I need an array of objects - I am just concerned about memory overhead in my application.

Thank you for any help.

The easiest way to get the list of all the art is T (and the album is the same method) of MediaStore To use Audio. Artists for search, for example, will find and show something like this:

  string [] proj = {MediaStore.Audio.Artists._ID, MediaStore.Audio.Artists.ARTIST, MediaStore Audio.Artists.NUMBER_OF_ALBUMS, MediaStore.Audio.Artists.NUMBER_OF_TRACKS}; MusicCrasar = Managed (MediaStore.Audio Artist: External, France, Faucet, Blank, Mediastore, Audio Artist + "ASC"); String [] = new string [] {MediaStore.Audio.Artists.ARTIST, MediaStore.Audio.Artists.NUMBER_OF_ALBUMS, MediaStore.Audio.Artists.NUMBER_OF_TRACKS}; Int for [] = new int [] {R.ID Songname, R.I.D., Orlandthant, R.Id.RoAntist}; Simple Cursor Adapter Adapter = New Simple Carrier Adapter (This, R.Lay Out.Masouro, MusicCarser, from, to); SongsView.setAdapter (adapter);  

Where songs will be your list to display these scenes. The rest are using a simple cursor adapter

Hope this helps


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -