vibration

Changing vibrate setting

安稳与你 提交于 2019-12-24 16:12:43
问题 Ok so I'm very new to android. My gf asked me to make a very simple app for her so she could easily switch from always vibrate to never vibrate. Seemed like a simple enough task. So I've got a toggle button, and it changes the setting, but I keep running into one big issue. It won't change between always and never. if I set it to always it will swap between always and only in silent mode, or if I set it to never it switches between only not in silent mode and never. did I miss some obvious

Where is the setting setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, false) in the phone?

扶醉桌前 提交于 2019-12-24 10:01:00
问题 i made an app that messes with the system vibrate settings. namely, it turns them off. AudioManager audioManager = (AudioManager)ctx.getSystemService(Context.AUDIO_SERVICE); audioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF); audioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, AudioManager.VIBRATE_SETTING_OFF); System.putInt(ctx.getContentResolver(), VIBRATE_IN_SILENT, 0); i wonder now, where i can turn the vibration manually

How long does AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) last?

时间秒杀一切 提交于 2019-12-24 09:27:38
问题 I don't have access an iPhone to test on right now. Can anyone tell me how long this call makes the phone vibrate? Thanks. 回答1: This article at http://www.kimballlarsen.com/2009/12/22/how-to-make-iphone-vibrate-for-a-long-time/ states that: AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) API call will produce exactly 0.4 seconds of vibration and 0.1 seconds of silence. 来源: https://stackoverflow.com/questions/3338006/how-long-does-audioservicesplaysystemsoundksystemsoundid-vibrate-last

UILocalNotification Not Working … No Vibration on iPhone 4 iOS 4.3

醉酒当歌 提交于 2019-12-23 15:00:13
问题 I would write as much as I could write here, but the Title pretty much says it all. I've tested it in several different situations: 1) Phone on, silent mode off, app on, in foreground, screen unlocked I know that this goes through app delegate's didReceiveLocalNotification and didn't expect a sound or vibration, except for the handling code that I included under didReceiveLocalNotification. The handling code actually called NSURL *Sound = [[NSBundle mainBundle] URLForResource: self

Vibrate settings on Android 2.2

余生颓废 提交于 2019-12-18 11:13:57
问题 I'm making a vibrate toggling widget (in fact, its first version is already in the Market) but I'm having some problems with the vibrate settings of Android 2.2. Up to Android 2.1 I have no problem, when I want to disable vibrate I do am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,AudioManager.VIBRATE_SETTING_OFF); am.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION,AudioManager.VIBRATE_SETTING_OFF); and the same but with VIBRATE_SETTING_ON on both lines to turn it on, and it

How to make an Android device vibrate?

↘锁芯ラ 提交于 2019-12-16 20:18:16
问题 I wrote an Android application. Now, I want to make the device vibrate when a certain action occurs. How can I do this? 回答1: Try: import android.os.Vibrator; ... Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); // Vibrate for 500 milliseconds if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { v.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE)); } else { //deprecated in API 26 v.vibrate(500); } Note: Don't forget to include permission in

How to make an Android device vibrate?

别来无恙 提交于 2019-12-16 20:17:09
问题 I wrote an Android application. Now, I want to make the device vibrate when a certain action occurs. How can I do this? 回答1: Try: import android.os.Vibrator; ... Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); // Vibrate for 500 milliseconds if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { v.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE)); } else { //deprecated in API 26 v.vibrate(500); } Note: Don't forget to include permission in

How to trigger Vibration on Sound Input?

老子叫甜甜 提交于 2019-12-13 12:26:29
问题 I am trying to create an android application where I filter one specific frequency of a beep and make the phone vibrate. I am taking input from the MIC of mobile and using MediaRecorder class, by using this class, I can record, save and play the input. Now I need my mobile to vibrate whenever there is a beep/or any sound. The input is given by a wire to the Headphone jack of the mobile so I know that there is only one frequency being input. I have a button, Clicking which starts recording. I

Vibrate iPhone 6S manually like peek and pop?

 ̄綄美尐妖づ 提交于 2019-12-12 07:37:57
问题 How can I manually trigger a single click-like vibration like the ones that happen when using peek&pop, or application shortcuts? 回答1: It seems that these guys have found a way to do it for iOS 9 for phones with Taptic Engine (including the iPhone 6S). http://unifiedsense.com/development/using-taptic-engine-on-ios.html I'm not sure if it applies to iOS 8 or any other phones. They've essentially retrieved the Taptic Engine interface from UIDevice and called actuateFeedback with an integer

Vibration even when the screen has timed out

蓝咒 提交于 2019-12-12 04:30:45
问题 I'm using the examples from this site: http://android.konreu.com/developer-how-to/vibration-examples-for-android-phone-development/ So, as you see, I'm using the Vibrator Service. The problem, which also is written on the site, is that the vibration don't work if the screen has timed out. Anyone has any ideas to fix this? It surely should work as the vibration works on phone calls, alarm etc. even though the screen is black. But maybe I have to wake up the phone before the vibration is called