-
-
Save novoda/374533 to your computer and use it in GitHub Desktop.
//Retrieve a list of Music files currently listed in the Media store DB via URI. | |
//Some audio may be explicitly marked as not being music | |
String selection = MediaStore.Audio.Media.IS_MUSIC + " != 0"; | |
String[] projection = { | |
MediaStore.Audio.Media._ID, | |
MediaStore.Audio.Media.ARTIST, | |
MediaStore.Audio.Media.TITLE, | |
MediaStore.Audio.Media.DATA, | |
MediaStore.Audio.Media.DISPLAY_NAME, | |
MediaStore.Audio.Media.DURATION | |
}; | |
cursor = this.managedQuery( | |
MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, | |
projection, | |
selection, | |
null, | |
null); | |
private List<String> songs = new ArrayList<String>(); | |
while(cursor.moveToNext()){ | |
songs.add(cursor.getString(0) + "||" + cursor.getString(1) + "||" + cursor.getString(2) + "||" + cursor.getString(3) + "||" + cursor.getString(4) + "||" + cursor.getString(5)); | |
} |
As i scroll it fast it gives me less song list. but if i scroll it slow it gives me more song.
Thank you very much
I was looking for a list of songs for a few days
And I found it here.
Thank You
any body knows how this is done on android Q , i have tried and this does not work and MediaStore.Audio.Media.DATA is deprecated too
How to get all mp3 files from a specific folder
how to list all audio files from storage specific folder and show in recyclerview in android
Hello every one, i recently created and Android class library for actions concerning the MediaStore and acces to media content on a device, It Called MediaFacer and it also support android 10 and 11 MediaStore changes. and it very easy to use
@shakeelAhmad123 what you are asking for can be done in few lines of code with MediaFacer
read this Medium article to understand how it works https://android.jlelse.eu/handling-media-files-with-mediafacer-library-for-android-cd9d2ca0dc68?source=friends_link&sk=02eb8a77e0d9f1958045a39550f0e3a0
MediaFacer on GitHub https://github.com/CodeBoy722/MediaFacer
Hello every one, i recently created and Android class library for actions concerning the MediaStore and acces to media content on a device, It Called MediaFacer and it also support android 10 and 11 MediaStore changes. and it very easy to use
@shakeelAhmad123 what you are asking for can be done in few lines of code with MediaFacer
read this Medium article to understand how it works https://android.jlelse.eu/handling-media-files-with-mediafacer-library-for-android-cd9d2ca0dc68?source=friends_link&sk=02eb8a77e0d9f1958045a39550f0e3a0MediaFacer on GitHub https://github.com/CodeBoy722/MediaFacer
Thank you so much for this amazing work, this part is making me cry for months and your library helped me learn a lot, I really appreciate your work :)
Thtat greate Thank you so much
Is using a content provider the right way to go about it? That is if you want to go from scratch?
Hello every one, i recently created and Android class library for actions concerning the MediaStore and acces to media content on a device, It Called MediaFacer and it also support android 10 and 11 MediaStore changes. and it very easy to use
@shakeelAhmad123 what you are asking for can be done in few lines of code with MediaFacer read this Medium article to understand how it works android.jlelse.eu/handling-media-files-with-mediafacer-library-for-android-cd9d2ca0dc68?source=friends_link&sk=02eb8a77e0d9f1958045a39550f0e3a0
MediaFacer on GitHub github.com/CodeBoy722/MediaFacer
Thank you so much for this amazing work, this part is making me cry for months and your library helped me learn a lot <3
How to use it?
- You have to add a listview in xml
- Then name that listview and add findviewbyid method to it
- Then use a adaptor whichever you can use
- For eg : ArrayAdapter ad = new ArrayAdapter(this,android.R.id.layout.simple_list_view_1,songs);
listview.setadapter(ad);
then it will list those .mp3 files in your activity!!
is not getting mp4 files