Question : how to make phone vibrate android studio
Answered by : thoughtless-termite-o5juln067vbq
// Vibrate for 150 milliseconds
private void shakeItBaby() { if (Build.VERSION.SDK_INT >= 26) { ((Vibrator) getSystemService(VIBRATOR_SERVICE)).vibrate(VibrationEffect.createOneShot(150, VibrationEffect.DEFAULT_AMPLITUDE)); } else { ((Vibrator) getSystemService(VIBRATOR_SERVICE)).vibrate(150); }
}
Source : https://stackoverflow.com/questions/13950338/how-to-make-an-android-device-vibrate-with-different-frequency | Last Update : Mon, 01 Feb 21