MobileUI
/
🔌 Vibrator
How to realize good vibrations in your app
The Vibrator Plugin PURPLE gives you a simple interface for letting the device vibrate for about 500ms.
Plugin Infos | |
---|---|
Dependency | "io.nevernull:mobileui-plugin-vibrator" |
Api Docs | io.nevernull.mobileui.plugin.vibrator |
Main Interface | io.nevernull.mobileui.plugin.vibrator.Vibrator |
Example Usage
Here is how to make good vibrations:
MainController.java
@Prototype
public class MainController {
@Inject
Vibrator vibrator;
public void onClick() {
vibrator.vibrate();
}
}
Note: iPads and iPods cannot vibrate, they are missing the required hardware 😔.