I am developing a media-player application. In the main activity, I have three tabs. First tab displays the audio files in a ListView, which I parsed from a URL. Clicking on the list item will play that file. Up-to this I finished. The second tab is to display the frequently played audio files. For example if a file get played for max of 5 times, it has to be displayed in the frequent tab. I thought to store the position of the list item in a SharedPreferences. But I don’t know how to achieve this. Need help.
I am developing a media-player application. In the main activity, I have three tabs.
Share
Why don’t you maintain a database of all the media content that is being played and then count how many times been played. If the number is greater than 5, then display it in the Frequently played list.
Your shared preferences ideally shouldn’t be doing what you’re trying to do. However; with the database in place, it would be a lot easier to add what you are trying to do.