Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/os/VibratorManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/os/VibratorManager#inhmethods)

# VibratorManager

*** ** * ** ***

` public abstract class VibratorManager `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.os.VibratorManager |

<br />

*** ** * ** ***

Provides access to all vibrators from the device, as well as the ability to run them in a synchronized fashion.

If your process exits, any vibration you started will stop.

<br />

## Summary

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/android/os/VibratorManager#cancel()() ` Turn all the vibrators off. |
| ` abstract https://developer.android.com/reference/android/os/Vibrator` | ` https://developer.android.com/reference/android/os/VibratorManager#getDefaultVibrator()() ` Returns the default Vibrator for the device. |
| ` abstract https://developer.android.com/reference/android/os/Vibrator` | ` https://developer.android.com/reference/android/os/VibratorManager#getVibrator(int)(int vibratorId) ` Retrieve a single vibrator by id. |
| ` abstract int[]` | ` https://developer.android.com/reference/android/os/VibratorManager#getVibratorIds()() ` List all available vibrator ids, returning a possible empty list. |
| ` final void` | ` https://developer.android.com/reference/android/os/VibratorManager#vibrate(android.os.CombinedVibration)(https://developer.android.com/reference/android/os/CombinedVibration effect) ` Vibrate with a given combination of effects. |
| ` final void` | ` https://developer.android.com/reference/android/os/VibratorManager#vibrate(android.os.CombinedVibration,%20android.os.VibrationAttributes)(https://developer.android.com/reference/android/os/CombinedVibration effect, https://developer.android.com/reference/android/os/VibrationAttributes attributes) ` Vibrate with a given combination of effects. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### cancel

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract void cancel ()
```

Turn all the vibrators off.   

Requires `https://developer.android.com/reference/android/Manifest.permission#VIBRATE`

<br />

### getDefaultVibrator

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Vibrator getDefaultVibrator ()
```

Returns the default Vibrator for the device.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Vibrator` | This value cannot be `null`. <br /> |

### getVibrator

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Vibrator getVibrator (int vibratorId)
```

Retrieve a single vibrator by id.

<br />

| Parameters ||
|---|---|
| `vibratorId` | `int`: The id of the vibrator to be retrieved. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Vibrator` | The vibrator with given `vibratorId`, never null. <br /> |

### getVibratorIds

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract int[] getVibratorIds ()
```

List all available vibrator ids, returning a possible empty list.

<br />

| Returns ||
|---|---|
| `int[]` | An array containing the ids of the vibrators available on the device. This value cannot be `null`. <br /> |

### vibrate

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void vibrate (CombinedVibration effect)
```

Vibrate with a given combination of effects.

Pass in a `https://developer.android.com/reference/android/os/CombinedVibration` representing a combination of `https://developer.android.com/reference/android/os/VibrationEffect` to be played on one or more vibrators.

The app should be in foreground for the vibration to happen.
.   
Requires `https://developer.android.com/reference/android/Manifest.permission#VIBRATE`

<br />

<br />

| Parameters ||
|---|---|
| `effect` | `CombinedVibration`: a combination of effects to be performed by one or more vibrators. This value cannot be `null`. <br /> |

### vibrate

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void vibrate (CombinedVibration effect, 
                VibrationAttributes attributes)
```

Vibrate with a given combination of effects.

Pass in a `https://developer.android.com/reference/android/os/CombinedVibration` representing a combination of `https://developer.android.com/reference/android/os/VibrationEffect` to be played on one or more vibrators.

The app should be in foreground for the vibration to happen. Background apps should specify a ringtone, notification or alarm usage in order to vibrate.
.   
Requires `https://developer.android.com/reference/android/Manifest.permission#VIBRATE`

<br />

<br />

| Parameters ||
|---|---|
| `effect` | `CombinedVibration`: a combination of effects to be performed by one or more vibrators. This value cannot be `null`. <br /> |
| `attributes` | `VibrationAttributes`: `https://developer.android.com/reference/android/os/VibrationAttributes` corresponding to the vibration. For example, specify `https://developer.android.com/reference/android/os/VibrationAttributes#USAGE_ALARM` for alarm vibrations or `https://developer.android.com/reference/android/os/VibrationAttributes#USAGE_RINGTONE` for vibrations associated with incoming calls. This value may be `null`. <br /> |