android - Default "beep beep" alarm ringtone -
is there default, safe use, "beep beep"-styled ringtone on andrid phones?
i have following code
final ringtone alarm = ringtonemanager.getringtone(getactivity(), ringtonemanager.getdefaulturi(ringtonemanager.type_alarm)); alarm.setstreamtype(audiomanager.stream_alarm); alarm.play();
it plays alarm ringtone wakes me @ morning, soothing music. need more alarming.
sure, can pack sound file apk, i'd prefer use sounds available on devices.
check answer here:
how access android's default beep sound?
try { uri notification = ringtonemanager.getdefaulturi(ringtonemanager.type_notification); ringtone r = ringtonemanager.getringtone(getapplicationcontext(), notification); r.play(); } catch (exception e) { e.printstacktrace(); }
here way list notifications sound have in device
public map<string, string> getnotifications() { ringtonemanager manager = new ringtonemanager(this); manager.settype(ringtonemanager.type_notification); cursor cursor = manager.getcursor(); map<string, uri> list = new hashmap<>(); while (cursor.movetonext()) { string notificationtitle = cursor.getstring(ringtonemanager.title_column_index); uri notificationuri = manager.getringtoneuri(cursor.getposition()); list.put(notificationtitle, notificationuri); } return list; }
after finding 'helium' ringtone, use uri play it:
uri heliumuri = findheliumuri(); ringtone r = ringtonemanager.getringtone(getapplicationcontext(), notification); r.play();
Comments
Post a Comment