1. Download our Official Android App: Forums for Android!

Apps random ringtone switcher

Discussion in 'Android Development' started by Abel M, Jun 11, 2011.

  1. Abel M

    Abel M Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Jun 11, 2011

    Jun 11, 2011
    3
    0
    5
    hi
    i have been trying to create an app that randomly selects a ringtone from a playlist after a set delay time or a timer. but i really dont know where to begin or even how i might be able to change the ringtone.
     

    Advertisement

  2. miXer

    miXer Android Enthusiast
    Rank:
    None
    Points:
    53
    Posts:
    313
    Joined:
    Aug 12, 2010

    Aug 12, 2010
    313
    51
    53
    Norway
    RingtoneManager.setActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE, ringtoneUri);
     
  3. Abel M

    Abel M Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Jun 11, 2011

    Jun 11, 2011
    3
    0
    5
    i tried 'RingtoneManager.setActualDefaultRingtoneUri(this,RingtoneManager.TYPE_RINGTONE,Uri.parse("mnt/sdcard/music.mp3"));' i have the music in the emulator
    but it didnt work.
    i have this after the above and it plays the file so i know i got the path right
    Ringtone rt = rm.getRingtone(this,Uri.parse("mnt/sdcard/music.mp3");
    rt.play();
     
  4. Abel M

    Abel M Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Jun 11, 2011

    Jun 11, 2011
    3
    0
    5
    i tried to get permission too and the app didnt crash but when i tried to see if the ringtone changed by sending an incoming call it showed that nothing had changed. any suggesstions?
     

Share This Page

Loading...