For my latest project i want the user to be able to make playlist and save them to the phone. I want to make so when they make them in the application they will also show up when they look in the built in music app. Whats the best way of doing this? I know i will probably have to use MediaStore but other than that I'm a tad lost. Any information would help, just need a nudge in the right direction - Thanks
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can use the content URI found in Media.AudioStore.Playlist class to access the playlist content provider. By inserting elements into the Playlist content provider you'll be able to the inserted playlists in the Music application.
Example code:
ContentResolver contentResolver = Context.getContentResolver();
//Get all the playlists
Cursor playlist = contentResolver.query(
Media.AudioStore.Playlist.getContentUri(Media.AudioStore.Playlist.EXTERNAL_CONTENT_URI));
You can play around with the classes more to get a better idea of how to use them. Note the inner class that Media.AudioStore.Playlist has, Media.AudioStore.Playlist.Memebers.