ringtone

android mediaplayer - play ringtone one time

白昼怎懂夜的黑 提交于 2019-12-19 11:44:07
问题 I try to play a device ringtone one time with the MediaPlayer class (I have to use MediaPlayer as I use the ringtones together with other audio sources in my app) So i try the following to play a random ringtone yet I cant stop it looping, it keeps playing. Is it possible to play a ringtone only one time with MediaPlayer. Thanks try { RingtoneManager mRing = new RingtoneManager(RingtoneActivity.this); int mNumberOfRingtones = mRing.getCursor().getCount(); Uri mRingToneUri = mRing

Android: save sound as ringtone / SQLiteConstraintException

跟風遠走 提交于 2019-12-19 09:58:44
问题 I'm trying to save a sound as a ringtone in Android using this code. It works like a charm but will fail if I try to save a ringtone that has already been inserted. A "SQLiteConstraintException" occurs while saving but I'm not able to catch the exception, in fact, I can't catch any execption. Here's the part of my code: Uri uri = MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()); try { this.getContentResolver().insert(uri, values); } catch (SQLiteConstraintException e) { Log.e(

Android detect which ringtone is actually playing (Ringtone.isPlaying problem)

▼魔方 西西 提交于 2019-12-19 09:54:25
问题 On Android, I'm having a problem trying to figure out which ringtone is actually playing (I'm not trying to detect the default ringtone, but the one actually playing as it may be different due to user setting a particular ringtone for a particular contact). I'm using the Ringtone.isPlaying() function as I cycle through (successfully) all the available Ringtones from the RingtoneManager. However none of them ever returns true to Ringtone.isPlaying()! Anyone have a clue what I am doing wrong?

External Storage Permission Issue with MediaProvider / Ring Tones

核能气质少年 提交于 2019-12-18 17:16:22
问题 Some of my users have reported to Google Play the following error when trying to select a ringtone in my app. (there's more to it, but it's not relevant) java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/audio/media from pid=5738, uid=10122 requires android.permission.READ_EXTERNAL_STORAGE I assume this issue is happening due to certain tones that are on external storage. I don't want to include the READ_EXTERNAL

External Storage Permission Issue with MediaProvider / Ring Tones

こ雲淡風輕ζ 提交于 2019-12-18 17:15:11
问题 Some of my users have reported to Google Play the following error when trying to select a ringtone in my app. (there's more to it, but it's not relevant) java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/audio/media from pid=5738, uid=10122 requires android.permission.READ_EXTERNAL_STORAGE I assume this issue is happening due to certain tones that are on external storage. I don't want to include the READ_EXTERNAL

Access iPhone's built-in ringtones

≯℡__Kan透↙ 提交于 2019-12-17 16:57:09
问题 I have a task to access the system ringtones in my iPhone application. I want to know if it is possible to access them? If not, please explain the reason. 回答1: No it's not possible via the official SDK. 回答2: No, it is not Possible in iPhone , If you want to submit your app in app store. 来源: https://stackoverflow.com/questions/8269982/access-iphones-built-in-ringtones

How can I set a ringtone for an individual contact on Android?

纵然是瞬间 提交于 2019-12-17 15:52:19
问题 How can I apply a ringtone to only the selected contact? I have found a way to set the default ringtone that applies to all contacts, but that is not my goal. I want an application to have a button ("Apply ringtone to contact") that, when clicked, starts an activityForResult displaying a list of all contacts on the phone. When a contact is selected, the contact activity closes and returns with a URI to the contact. Then the app needs to apply the selected ringtone to that specific contact.

Setting Ringtone in Android [duplicate]

点点圈 提交于 2019-12-17 02:44:11
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to set ringtone in Android from my activity? I have sounds files in my res/raw folder and i want to select a sound to set as a ringtone on the click of a button. Wonder how can i do that? 回答1: @Maxood The code from @Clive is what you need to set the ringtone. You will need the absolute path to the file, which you can't get from a raw resource. The solution is to get the resource file asset and write it to

React native System Soungs/Ringtones

为君一笑 提交于 2019-12-14 01:52:58
问题 How can i get the list of system tones in react native e.g ring tones, notification tones, so that i can give users choice to set them as notification tone? I looked into some libraries like react-native-ringtone-manager and react-native-sound but did't find this functionality. 回答1: I am surely late, this is a solution I wrote on medium : Implement Native Module Go to : D:\Projects\VSCode\liturgikMobile\node_modules\react-native-ringtone-manager\android\src\main\java\com\reactlibrary

How do I change the Android SMS tone despite of current SMS tone setting?

我是研究僧i 提交于 2019-12-13 02:38:48
问题 I have developed an Android application for changing ringtones. It works quite well, but one thing bothers me. When I set a ringtone as a notification tone, it plays when I receive an SMS message. However, if I have chosen a custom SMS tone earlier (ie. anything else than "Default ringtone" which is active by default) in the SMS settings, the new notification tone will not play when I receive an SMS. This might lead to a situation in which someone installs the ringtone app from the Android