Phone Vibrate Android Studio

  1. Open your device’s Settings app .
  2. Tap Accessibility.
  3. Tap Vibration & haptic strength.
  4. Review or change the following settings: Ring vibration. Notification vibration. Touch feedback
// Vibrate for 90 milliseconds
private void shakeItBaby() {
    if (Build.VERSION.SDK_INT >= 26) {
        ((Vibrator) getSystemService(VIBRATOR_SERVICE))
            .vibrate(VibrationEffect.createOneShot(90, VibrationEffect.DEFAULT_AMPLITUDE));
    } else {
        ((Vibrator) getSystemService(VIBRATOR_SERVICE)).vibrate(90);
    }
}