samedi 17 octobre 2015

Android setting Ringtone by referring its id from Media Database

I am developing an android application in which I will get user selected ringtones, then I will store the positions of Ringtone in Sq-lite.

I am bit confused about android RingtoneManager,

RingtoneManager rm = new RingtoneManager(context);
RingtoneManager.setActualDefaultRingtoneUri(context,
        RingtoneManager.TYPE_RINGTONE, rm.getRingtoneUri(position));

I am going to use the above to set it up as a Default Ringtone. I assume 'position' is the id of my audio file in Media Database.

My doubt is if the audio file deleted from the SD storage will it be removed from Media Database too. If so is there any chance where another audio file takes the id of deleted file in Media Database.

In the above case my application would refer to wrong Ringtone that should not happen.

Please help me out on this.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire