Questions tagged [android-vibration]

The Android framework includes support for Vibration available on devices, allowing you to control the device's vibrations from your application. Questions regarding practical and advanced use of Vibrations must fall under this tag.

202 questions
3
votes
0 answers

Android Vibrate with screen off

Considering the answers here and here are not providing an actual solution to the same problem and are more than a year old... I have a Vibrator. I know how to fully control the vibrator. I have the following two issues: When it's vibrating and the…
Twinone
  • 2,949
  • 4
  • 28
  • 39
3
votes
2 answers

vibrate phone in background

The more I read, more confuse I get. I'm trying to make one simple program where the phone vibrates every minute and updates a text field. My application runs fine when display is on and as it should, stops working when display is off. First I…
Animesh
  • 47
  • 1
  • 5
2
votes
3 answers

device vibration keeps repeating infinitely

im trying to vibrate device and repeat this pattern for 3 times so in total 6x vibrations. Im using code bellow but my device keeps vibrating infinitely. How to stop vibrating after those 3 repeats? private void deviceVibration (){ long[]…
zon1k
  • 87
  • 7
2
votes
0 answers

Change vibration sound like in Samsung Clock app

I wonder if it is possible to change the tone (not amplitude) of the vibration like it is done on Samsung Clock app. You can hear it in here: https://youtu.be/3yyOSH5RP5g?t=134 The sound of the vibration on "off-beat" is different from all the ones…
Kaleega
  • 127
  • 5
2
votes
1 answer

VibrationEffect doesn't change the amplitude of the vibes on my Galaxy S8

this is the code: public class Vibrate extends AppCompatActivity { long[] timings = {1000, 1000, 1000, 1000}; int[] amplitudes = {0, 5, 250, 5}; @Override protected void onCreate(Bundle savedInstanceState) { …
2
votes
1 answer

android: stop notification from vibrating

Hello i am building a notification with NotificationCompat.Builder notificationBuilder = (NotificationCompat.Builder) new NotificationCompat.Builder(this, "default") .setShowWhen(false) .setStyle(new…
Ginso
  • 459
  • 17
  • 33
2
votes
1 answer

Change or get current vibration intensity or make forceful vibration

I've a diagnostic app which currently tests vibration including other kind of tests as well. In case of vibration, it vibrates and asks user to input the count of vibration. Here is the code snippet I've been using, vibrator = (Vibrator)…
Shree Krishna
  • 8,474
  • 6
  • 40
  • 68
2
votes
1 answer

Is Android going to enable vibration amplitude controls for older OS versions?

Starting in 8.0, Android will (finally) let us control vibration amplitude as well as duration (api 26 link). Does anyone know (maybe from past experience with features added) if it will be possible to control vibration amplitude in older devices…
2
votes
1 answer

App crashes when using Vibrator, even though hasVibrator() returns true

I'm working on a small app that involves vibration, and whenever the vibrate() function is called, the app crashes. The stack trace links back to the vibrator.vibrate() line with the text "Vibrator: Failed to vibrate." vibrator. There are also a…
user4390998
2
votes
2 answers

is the vibration for call setting accessible in android?

Is there a way I can access the system preference for vibration settings? I have an alarm-like app which I want to inherit the vibration setting from the phone's ring/sound settings. However, I do not know how to programmatically access these…
damonkashu
  • 1,813
  • 5
  • 19
  • 25
2
votes
0 answers

Android Wear runnable for vibration works only in debug or with an active screen

i'm facing a big issue with android wearable development. I've got a Runnable task that runs with an Handler every 100mS (it's purpose is to behave just like a chronograph) on my phisical wearable device (that's a Motorola 360). When the Runnable…
2
votes
2 answers

Android Wear Watch Face Vibrate With Screen Off

I have an Android Wear watch face that I'm trying to have vibrate the watch on the hour. It is working except in cases where the watch screen is off. According to the log statements, the handler method is called every minute and the chime method is…
Chris A.
  • 23
  • 4
2
votes
3 answers

Android; detect if the Vibrate setting in the device is on or off, esp for the case when it rings but does not vibrate

App requirement: To detect when a phone is on Ringing mode with the Vibrate Setting being OFF so the problem comes down to : detect whether the Vibrate Setting is OFF or ON Relevant information: To start with, Vibrator has no method like…
Pararth
  • 8,114
  • 4
  • 34
  • 51
2
votes
1 answer

How to Enable/Disable vibrate for calls and notifications in Android Lollipop?

This is not working for Lollipop. To Enable vibration: audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_ON); audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, …
2
votes
2 answers

android: how to control the frequency of vibration via ON/OFF pattern

I'm trying to control the vibration frequency of android phone. I understand android API provides an interface to control the vibration via ON/OFF patterns: public void vibrate (long[] pattern, int repeat) Vibrate with a given pattern. Pass in an…
Jason Yang
  • 554
  • 7
  • 25