Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Set power of vibration

Tags:

android

I'm currently working on a project, where I'd like to use the vibrating motor situated inside the Android phone.

I'd figured out, that setting the right permission in the manifest and getting an instance of the vibrator:

Vibrator v = (Vibrator) game.getSystemService(Context.VIBRATOR_SERVICE);

would give me access to it. As far as I can see the only methods to make it vibrate are:

public abstract void vibrate (long milliseconds)

and

public abstract void vibrate (long[] pattern, int repeat)

Yet I'd like to have control the power of the vibration:

How can I control the power of the vibration?

Update:

Shouldn't the speed be controlled by varying voltage (or PWMing DC)?

like image 385
Luke Taylor Avatar asked Jul 14 '12 10:07

Luke Taylor


People also ask

How do you change the vibration intensity?

To access it, open the “Settings” app and go to Sounds And Vibration > Vibration Intensity. Tune the available sliders to adjust the vibration intensity of incoming calls, notifications, and touch interaction response to your liking.

How can I increase the vibration of my motor?

There are several ways to increase a motor's vibration strength, such as increasing the motor speed, the eccentric mass, or the mass' distance from the motor shaft.


1 Answers

As per the below, I don't believe it's possible to control the intensity. What you could do is use short bursts so the device doesn't vibrate as fast? But I've not tested this personally.

http://developer.android.com/reference/android/os/Vibrator.html and controlling vibration intensity in android phones? is it possible?

like image 69
Stuart Avatar answered Sep 20 '22 05:09

Stuart