I am currently offering a functionality for my app for which I display all the available system notification sounds to the user.
Now I want to detect the custom notification sounds that may be there in internal memory as well as SD card.
Currently I am thinking of getting a list of all available audio files and then filtering them by their duration (since notification sounds are very short in length).
Is there a better approach to detect custom notification sounds on the device? Answers with corresponding code would be highly appreciated.
RingtoneManager.getCursor()
gives you a method to get all ringtones. Look below code ofRingtoneManager.getCursor()
.