ringtone

Get resource id from content://settings/system/ringtone?

两盒软妹~` 提交于 2019-12-09 22:00:42
问题 When I pick the default ringtone, I get a Uri with path content://settings/system/ringtone . So there is no path ending with integer, as in returning a usual rintone (for example, content://media/internal/audio/media/38 ). How can I now get a resource id from this default ringtone? Any parsing is impossible since there is no any integer identification. 回答1: If your check the setting db, you will find the content save to setting db is media uri. That means below uri actually is a map to media

Why RingtoneManager.setActualDefaultRingtoneUri could not work? [android API-8]

二次信任 提交于 2019-12-09 17:10:11
问题 This question could be duplicate of this question but I see some difference in code, so I put a new question. Problem is that I cannot set picked ringtone in RingtonePicker. I use Support Library and AndroidAnnotations, maybe it can cause such problems (though I doubt it). I have Fragment with a button in it. When clicking on button a RingtonePicker is fired. User select ringtone and application saves it in SharedPreference. Next time when user open RingtonePicker, previously selected

Using iPhone default Alarm sounds in application [duplicate]

倖福魔咒の 提交于 2019-12-09 07:08:40
问题 This question already has an answer here : Closed 8 years ago . Possible Duplicate: Play alert sound (same as default message ringtone) Hello all, Quick question - Is it possible to use one of the default sounds included on the iPhone - Marimba etc. in an iPhone application? Thanks, Teja 回答1: The actual directories will only be accessible after JailBreak. Ringtones (including Marimba): /Library/Ringtones/ System sounds: /System/Library/Audio/UISounds/ Or use 'AudioServicesPlaySystemSound()'

Get custom ringtone incoming call of Android

淺唱寂寞╮ 提交于 2019-12-08 18:14:30
I can use below code to get current ringtone of incoming call Uri defaultRintoneUri = RingtoneManager.getActualDefaultRingtoneUri( getApplicationContext(), RingtoneManager.TYPE_RINGTONE); defaultRingtone = RingtoneManager.getRingtone(getApplicationContext(), defaultRintoneUri); But I want to get custom ringtone which is set by other application. How can I get it? If the ringtone is used only for that application, then probably that ringtone file is private and owned only by that application. You won't have access to it, this is the security system on Android. Every app runs basically as a

can I make ringtone in preferences

白昼怎懂夜的黑 提交于 2019-12-08 09:14:48
问题 How can I make ringtone activity (that always appear in setting) so the user can choose her ringtone from system ringTones I googled it but I didn't find complete tutorial, I am really confused, please give me tutorial or some codes. Also, if I want the user to choose the special ringtone to Notification in my application should i use Shared preference or preference? I already did the Menu: // Menu Code Part#2 public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) {

How to set ringtone in Android from my activity?

无人久伴 提交于 2019-12-08 07:20:53
问题 I'm trying to find a way to set a new default ringtone by code from my Android activity. I have already downloaded the ringtone into a bytearray . 回答1: Finally, I managed to set the default ringtone to one that i downloaded. The download code is not included below, only what was needed to set it as default ringtone. File k = new File(path, "mysong.mp3"); // path is a file to /sdcard/media/ringtone ContentValues values = new ContentValues(); values.put(MediaStore.MediaColumns.DATA, k

Get custom ringtone incoming call of Android

淺唱寂寞╮ 提交于 2019-12-08 07:18:56
问题 I can use below code to get current ringtone of incoming call Uri defaultRintoneUri = RingtoneManager.getActualDefaultRingtoneUri( getApplicationContext(), RingtoneManager.TYPE_RINGTONE); defaultRingtone = RingtoneManager.getRingtone(getApplicationContext(), defaultRintoneUri); But I want to get custom ringtone which is set by other application. How can I get it? 回答1: If the ringtone is used only for that application, then probably that ringtone file is private and owned only by that

Can't play a ringtone from a ContentProvider

岁酱吖の 提交于 2019-12-08 04:18:06
问题 I'm trying to play a ringtone using a ContentProvider, this works great using a contact ringtone (openFile | openAsset is called within my content provider) final ContentValues values = new ContentValues(); values.put(ContactsContract.Contacts.CUSTOM_RINGTONE, MY_CONTENT_PROVIDER_URI.toString()); final Uri uri = Uri.withAppendedPath( ContactsContract.Contacts.CONTENT_URI, Uri.encode(String.valueOf(contact))); mContext.getContentResolver().update(uri, values, null, null); However won't work

Android: save sound as ringtone and notification

无人久伴 提交于 2019-12-06 03:26:20
问题 I'm saving a sound from my app to be used as a ringtone or a notification sound. Here's part of my code, taken from this page: ContentValues values = new ContentValues(); values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath()); values.put(MediaStore.MediaColumns.TITLE, soundName); values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/ogg"); values.put(MediaStore.Audio.Media.ARTIST, "artist"); values.put(MediaStore.Audio.Media.IS_RINGTONE, true); values.put(MediaStore.Audio.Media.IS

Setting sound for notification

帅比萌擦擦* 提交于 2019-12-05 12:32:57
How can I set sound for notification for my android application. In my application notification will be shown after 30 seconds. I want to give options for this alerts such as silent mode, vibration mode and an option to select from the available tones from the device. I am using the preference screen to show the settings menu. I want to to set the notification ring type application specific. Is there any way to establish this.. http://developer.android.com/reference/android/app/Notification.Builder.html#setSound(android.net.Uri ) Notification.Builder.setSound(); Use a ringtone preference in