Is there a way to get the number of songs / recently played songs on Android?

I am wondering if there is a way to access top playable / recently played songs or play counts for songs on Android? I looked at getting information from a content recognizer using MediaStore , but I did not find anything. There are a lot of things, so I might have missed something. I also looked at MediaMetadataRetriever , but I can't see anything either. Looking at Wikipedia, it’s shown that ID3v2 tags can contain a play counter, but is it available via Android?

+4
source share
2 answers

Here is a link stating that it should be possible using the id3 tag library.

FrameBodyPCNT is the play counter class that you want to use from the id3 tag library.

+1
source

As a partial answer, I had an idea when I was playing with this to use the lastModified() method (since I was going through all the songs like File anyway). In the end, this functionality was revised, so I did not test it, but using lastModified() , and taking these songs with the highest value, I should give you the latest playable / added songs (since I assume that the ID3 tags will be slightly changed each time playback, especially since there is a playback counter).

However, I am going to wait a little longer to find out if anything else comes up.

+1
source

All Articles