public final class

Vibrator

extends Object
java.lang.Object
   ↳ com.neomades.io.Vibrator

Class Overview

Class that handles the vibrator on the device.
By default the vibrator vibrates continuously during the fixed period.

To use this class, the VIBRATE permission must be declared in the URS file.

To get a vibrator instance, use the Vibrator.getVibrator() method.

Cross Platform Considerations

In iOS, the vibrator vibrates at intervals of 1 second during the fixed period..

Summary

Public Methods
static Vibrator getVibrator()
Get the device vibrator class utility.
boolean hasVibrator()
Return if the device has vibrator.
Vibrator setDuration(long duration)
Set the vibration duration in milliseconds.
void startVibration()
Vibrate with the current vibrator settings (duration...).
void stopVibration()
Turn the vibrator off.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static Vibrator getVibrator ()

Get the device vibrator class utility.

Returns
  • the current device vibrator.

public boolean hasVibrator ()

Return if the device has vibrator.

Returns
  • true if the device could vibrate.

public Vibrator setDuration (long duration)

Set the vibration duration in milliseconds.

Parameters
duration in milliseconds
Returns
  • the current vibrator instance.

public void startVibration ()

Vibrate with the current vibrator settings (duration...).

Throws
SecurityException if the VIBRATE permission has not been set into the URS File

public void stopVibration ()

Turn the vibrator off.