Created
October 17, 2014 16:01
-
-
Save pracucci/6d8a8c091a3e03bb0060 to your computer and use it in GitHub Desktop.
content://com.google.android.music.MusicContent/audio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cursor cursor = getActivity().getContentResolver().query( | |
Uri.parse("content://com.google.android.music.MusicContent/audio"), | |
new String[] { "_id", "CanonicalName" }, // new String[]{"_id", "playlist_name"}, | |
null, null, null); | |
// android.database.sqlite.SQLiteException: no such column: SongCount (code 1): , while compiling: SELECT null AS containerType, CanonicalAlbum, CanonicalName, max(Nid) AS Nid, Album AS album, (MIN(LocalCopyType) != 300) AS hasRemote, null AS domainParam, max(StoreAlbumId) AS StoreAlbumId, Composer AS composer, 'audio/*' AS mime_type, count(distinct(SongId)) AS _count, SongCount AS keeponSongCount, Genre AS Genre, Year AS year, Size, 0 AS bookmark, Domain, 1 AS is_music, DiscNumber, MUSIC.SourceId AS SourceId, FileDate, CanonicalAlbumArtist AS artistSort, Rating, null AS containerName, BitRate, null AS containerId, MUSIC.SourceAccount AS SourceAccount, AlbumArtist, AlbumArtistId, (MAX(LocalCopyType) IN (100,200,300)) AS hasLocal, NOT EXISTS(select 1 from MUSIC AS m WHERE MUSIC.SongId=m.SongId AND +m.TrackType != 5 LIMIT 1) AS isAllPersistentNautilus, null AS trackAvailableForPurchase, null AS itemState, max(ArtistArtLocation) AS ArtistArtLocation, 0 AS is_podcast, Title AS title, MUSIC.Id AS _id, StoreId, GenreId, null AS trackAvailableForSubscription, DiscCount, Artist AS artist, max(ArtistMetajamId) AS ArtistMetajamId, TrackCount, null AS artworkUrl, TrackNumber AS track, 1 AS hasAny, ArtistId AS artist_id, max(AlbumArtLocation) AS AlbumArtLocation, KEEPON.KeepOnId AS KeepOnId, Compilation, MUSIC.AlbumId AS album_id, Duration AS duration, MUSIC.Id AS audio_id, DownloadedSongCount AS keeponDownloadedSongCount, SongId FROM MUSIC WHERE ((MUSIC.SongId IN (SELECT SongId FROM MUSIC GROUP BY CanonicalName, SongId) )) GROUP BY CanonicalName, SongId | |
System.out.println("Num rows: " + cursor.getCount()); | |
while (cursor.moveToNext()) { | |
for (int i = 0; i < cursor.getColumnCount(); i++) { | |
System.out.print(cursor.getColumnName(i) + ": "); | |
switch(cursor.getType(i)) { | |
case Cursor.FIELD_TYPE_INTEGER: | |
System.out.print(cursor.getInt(i)); | |
break; | |
case Cursor.FIELD_TYPE_STRING: | |
System.out.print(cursor.getString(i)); | |
break; | |
case Cursor.FIELD_TYPE_FLOAT: | |
System.out.print(cursor.getFloat(i)); | |
break; | |
case Cursor.FIELD_TYPE_NULL: | |
System.out.print("null"); | |
break; | |
case Cursor.FIELD_TYPE_BLOB: | |
System.out.print("blob"); | |
break; | |
} | |
System.out.print(", "); | |
} | |
System.out.println(""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment