ringtone

android.media.Ringtone.play() stops working after a 28 plays

馋奶兔 提交于 2019-12-24 09:55:00
问题 I have an app that is open for hours and uses a background service with foreground notification attached to it. Every once in a while a sound is played using: try { Ringtone r = RingtoneManager.getRingtone(context, uri); r.play(); } catch (Exception e) { e.printStackTrace(); } The sounds are working, but after a while the sounds don't play anymore. No errors, no warnings, no crashes. Just no sound. My users are complaining as well, so it doesn't look like a device specific issue. Android Docs

Access apple's iOS ringtones and display them [duplicate]

非 Y 不嫁゛ 提交于 2019-12-24 09:26:26
问题 This question already has answers here : Access iPhone's built-in ringtones (2 answers) Closed 6 years ago . I'm working on an app which has a messaging system in it. I want to the user to setup their own ringtone from the ones provided by Apple, or use something in the iPod library. All of the answers am finding are saying Apple doesn't allow us to access these ringtones, but there are plenty of apps, including Whatsapp, which shows you a list for Apple's ringtones for the user to set a text

BlackBerry - read custom ringtone name from address book contact list?

血红的双手。 提交于 2019-12-24 08:20:07
问题 Actually I am assigning custom ringtone with contact number in a custom database contact list. Now I am having problem with the reading to that contact list. If anyone having any idea about this problem pls pls help. UPDATE public void showAddressBook() { try { ContactList contactList = (ContactList) PIM.getInstance() .openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE); Enumeration enumx = contactList.items(); while (enumx.hasMoreElements()) { Contact c = (Contact) enumx.nextElement(); int[]

Copy file from iPhone app to iTunes

二次信任 提交于 2019-12-23 03:21:31
问题 I am trying to figure out how to copy a ringtone file (.m4r) embedded in the app to iTunes when connected. After the file is copied into iTunes, they can simply sync the file like every other file. I know this is possible, since there are other ringtone apps that do this exact same thing. If someone could point me in the right direction or maybe provide some sample code, that would be great. Thanks. 回答1: You can share files from your app's Documents directory with iTunes. Simply add the

Troubles play sound in silent mode on Android

非 Y 不嫁゛ 提交于 2019-12-21 19:49:30
问题 I am writing an android application to simply play an alarm no mater what mode the phone even if it is in silent mode. I found this question and used the code from the answer to override the current volume state. My code looks like this: Uri alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM); if (alert == null){ // alert is null, using backup alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); if (alert == null){ // alert backup is null, using 2nd backup

Add ringtones in android emulator

北慕城南 提交于 2019-12-21 12:19:12
问题 Does anyone know how to add/download a ringtone or an mp3 sound to an android emulator? 回答1: Go to DDMS in Eclipse , click the File Explorer tab and navigate to mnt/sdcard . Create a new folder by clicking the Plus icon called ringtones . Then click on the "Push a file on to the device" icon and choose your file. You may need to restart the emulator. 回答2: From Eclipse: Click on Window -> Open Perspective -> DDMS Note: First start the emulator, so its contents will be available under File

Getting a list of available Ringtones in Android

我只是一个虾纸丫 提交于 2019-12-21 03:37:15
问题 I've seen plenty of examples of how to set a default ringtone, but what I'm more interested in is being able populate a drop down box list filled with the available ringtones on the phone. So the list that people see when they change their ringtone in the android settings, I want to be able to list all of those. The closest thing I've found is here, but again this is just for setting the default ringtone. Any ideas anyone? It can be in or out of ringtonemanager. 回答1: This will return you the

Display list of default ringtones in iOS

房东的猫 提交于 2019-12-20 10:27:39
问题 I just want to show the list of default ringtones to allow the user select one to set as ringtone for a new notification. Is that possible? 回答1: #import <MediaPlayer/MediaPlayer.h> - (IBAction) AddMusicOrShowMusic: (id) sender { MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeMusic]; picker.delegate = self; picker.allowsPickingMultipleItems = NO; picker.prompt = NSLocalizedString (@"Add songs to play", "Prompt in media item picker"); [

How do I stop the currently playing ringtone?

别来无恙 提交于 2019-12-20 10:25:17
问题 I'm writing an app that sometime fires reminders that are supposed to play ringtones. I can start the ringtone OK, but can't stop it. I have a dismiss method in my fragment that should stop the currently playing ringtone and close the activity, but it doesn't work right. Here's what it does: RingtoneManager ringMan = new RingtoneManager(getActivity()); ringMan.stopPreviousRingtone(); getActivity().finish(); The method does get executed and the activity closes, but the ringtone just keeps on

How can I programmatically determine the default ringtone on an iPhone?

落花浮王杯 提交于 2019-12-19 22:23:48
问题 Is there a way to determine which ringtone has been set as the default one on the user's iPhone from within my application? If so, how can this be done? /Users/nikhil.dhamsania/Library/Application Support/iPhone Simulator/User/Media/iTunes_Control/iTunes/ringtones.plist This is the path where the ringtones.plist file exist in the simulator can we do something like getting the status for active ringtone in the iPhone? 回答1: Sorry to say that but Apple is damn conservative.You cannot use or