Questions tagged [vibration]

Vibration is a kind of user interaction or attention feedback provided by some devices.

Vibration is a kind of user interaction or attention feedback provided by some devices.

Starting point.

437 questions
602
votes
14 answers

How to make an Android device vibrate? with different frequency?

I wrote an Android application. Now, I want to make the device vibrate when a certain action occurs. How can I do this?
Billie
  • 8,938
  • 12
  • 37
  • 67
233
votes
12 answers

Making the iPhone vibrate

How can the iPhone be set to vibrate once? For example, when a player loses a life or the game is over, the iPhone should vibrate.
some_id
  • 29,466
  • 62
  • 182
  • 304
149
votes
11 answers

How to make iPhone vibrate using Swift?

I need to make the iPhone vibrate, but I don't know how to do that in Swift. I know that in Objective-C, you just write: import AudioToolbox AudioServicesPlayAlertSound(kSystemSoundID_Vibrate); But that is not working for me.
Nico Gutraich
  • 1,743
  • 3
  • 12
  • 9
73
votes
2 answers

Are there APIs for custom vibrations in iOS?

Starting in iOS 5, users are able to create custom vibration patterns for alerts and rings. The following screenshot shows the UI for creating one (Contacts app in iOS 6): I've been searching around, including the documentation, and I cannot find…
Andrew
  • 2,770
  • 1
  • 22
  • 29
54
votes
6 answers

How to enable haptic feedback on button view

I want to add haptic feedback to my application's buttons and control them programmatically to show button state (enabled and disabled). The default haptic feedback setter works only for long press. How can i make it work for simple button…
Kshitij Aggarwal
  • 5,287
  • 5
  • 34
  • 41
40
votes
11 answers

Disable vibration for a notification

I'm writing an app using notification. Google developer guidelines encourages developers to provide settings to customize the notifications (disable vibration, set notification sound...), so I am trying to disable vibration for notifications if the…
nstCactus
  • 5,141
  • 2
  • 30
  • 41
28
votes
8 answers

'VIBRATOR_SERVICE: String' is deprecated for API 31

As the title says, i upgraded to API 31. I had a function to perform a vibration, but in the line val vib = this.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator the VIBRATOR_SERVICE is now shown as deprecated. How can i replace it? Or at…
m.i.n.a.r.
  • 922
  • 2
  • 12
  • 28
27
votes
5 answers

How to implement vibration with Flutter for both Android and iOS?

Using Flutter I am trying to implement vibration on a button click. I find it surprisingly difficult to be honest. I've tried using the following packages unsuccessfully: vibration and vibrate but they just do not vibrate (talking here about the…
Miha
  • 13,223
  • 2
  • 15
  • 16
27
votes
6 answers

How can I make vibrate animation for ImageView

I have no idea for this animation. How can I do it via XML like that? Or another solution?
Nam Vu
  • 5,669
  • 7
  • 58
  • 90
26
votes
5 answers

Vibrate onclick

Is there a way to get a button to vibrate but only when the if condition is verified? Here's the code: Vibrator vibe = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE) ; if(l2>=l1){ insertactone.setBackgroundColor(Color.RED); …
Rui Miranda
  • 319
  • 1
  • 4
  • 9
22
votes
1 answer

How to provide customized vibration on specific incoming calls

The program functions like this: the user has a list of phone numbers, for which the cellphone could vibrate upon an incoming call only when no other system-wide application would provide vibration (such as in mute mode). I know that this is…
peter
  • 1,034
  • 1
  • 9
  • 23
20
votes
6 answers

How to vibrate Android device on button click using vibrator effects using Kotlin?

How to vibrate an Android device coding with Kotlin when pressing any buttons? I have used this code below, but there aren't any effects or vibrations performed. //click listener imgNextBtn.setOnClickListener { val vibe:Vibrator =…
Davinder Goel
  • 763
  • 2
  • 8
  • 22
18
votes
3 answers

Navigator vibrate break the code on ios browsers

I want to use navigator.vibrate on my page. This is my code: var canVibrate = "vibrate" in navigator || "mozVibrate" in navigator; if (canVibrate && !("vibrate" in navigator)) { navigator.vibrate = navigator.mozVibrate; } …
Kiyarash
  • 2,437
  • 7
  • 32
  • 61
18
votes
1 answer

Make the wearable vibrate from within an android wear app

I'm writing a simple wearable app to my LG watch that sends vibrations to the watch on constant intervals and show some mock data. Although I've looked for an answer, I could't find a way to make the watch vibrate. Any help would be appriciated.
Jacob
  • 797
  • 1
  • 6
  • 14
17
votes
5 answers

Vibrate when hold down button

I am making an app where the user holds down a button to make the phone vibrate and i'm not sure how to make it so only when the button is being held down it vibrates, my code so far is. package one.two.bn; import android.app.Activity; import…
Lucas
  • 191
  • 1
  • 1
  • 4
1
2 3
29 30