MohammadAG Posted February 25, 2014 Share Posted February 25, 2014 Hi, I'm trying to make an app that would need to list Poweramp's playlists along with their names.Querying the content provider for content://com.maxmpz.audioplayer.data/playlists returns me this:D/Poweramp(10779): Listing playlistsD/Poweramp(10779): _idD/Poweramp(10779): 14D/Poweramp(10779): 12D/Poweramp(10779): 4D/Poweramp(10779): 2D/Poweramp(10779): 1D/Poweramp(10779): 3D/Poweramp(10779): 7D/Poweramp(10779): 8D/Poweramp(10779): 5D/Poweramp(10779): 9D/Poweramp(10779): 11D/Poweramp(10779): 13D/Poweramp(10779): 10D/Poweramp(10779): 6Which are IDs, my question is, how do I query for the name? The database has that in the table "folder_playlists" under column "name".Caused by: java.lang.IllegalArgumentException: Unknown URI content://com.maxmpz.audioplayer.data/playlists/11 Link to comment Share on other sites More sharing options...
flyingdutchman Posted July 11, 2014 Share Posted July 11, 2014 public Cursor getpampPlaylistcursor(Context context,Cursor cursor) {// From Poweramp v2.1, playlists will be an isolated de-normalized table, which will contain track// data - i.e. path, track title/artist/album/duration // // content://com.maxmpz.audioplayer.data/playlists - all playlists// content://com.maxmpz.audioplayer.data/playlists/ID - playlist by ID// content://com.maxmpz.audioplayer.data/playlists/ID/files - tracks in playlist ID String[] proj = { "_id", "name"}; final Uri playlistUri = Uri.parse("content://com.maxmpz.audioplayer.data/playlists"); Cursor playlistCursor = getContentResolver().query(playlistUri, proj, null, null, null); return playlistCursor; } This is as far as I got as Poweramp does not provide anything else to allow you to write/amend playlists. Check out my threads on this forum as this has a lot more: http://forum.powerampapp.com/index.php?/topic/4679-how-to-update-the-Poweramp-playlist-in-android/ Link to comment Share on other sites More sharing options...
flyingdutchman Posted July 11, 2014 Share Posted July 11, 2014 Although it is not possible to update the Poweramp playlist, I did manage to interrogate the database and return valuesIn its simplest form:final String pamptrack_id = "folder_files._id";final String pamptrack_no = "folder_files.track_number";final String pamptrack_name = "folder_files.name";final String pampartist = "artists.artist";final String pampduration = "folder_files.duration";final String pampalbum = "albums.album";final String pampyear = "folder_files.year";final String pamppath = "folders.path";final String pamprating = "folder_files.rating";final String pamptimes_played = "folder_files.played_times";final String pamplast_played = "folder_files.played_at";final Uri uri = Uri.parse("content://com.maxmpz.audioplayer.data/files"); public Cursor getpampTrackTrackcursor(Context context, Cursor cursor){// gets all tracksContentResolver cr = context.getContentResolver();String[] proj ={ pamptrack_id, pamprating,pamptimes_played, pamplast_played };cursor = cr.query(uri,proj,null,null,null);return cursor;} gohttps://play.google....stmanager&hl=ento see this is action Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.