Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to make phone vibrate android studio

// 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);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: basic hello world program in java 
Java :: android.support.design.widget.coordinatorlayout androidx 
Java :: import android.support.v7.app.appcompatactivity error 
Java :: convert string to localdatetime 
Java :: round jframe corners in java 
Java :: java list string package import 
Java :: getcolor deprecated 
Java :: for with two values java 
Java :: spigot repeating task 
Java :: bukkit scheduler delay task 
Java :: find maven version 
Java :: java stream find specific element 
Java :: Cannot resolve class android.support.design.widget.AppBarLayout 
Java :: remove double quote java 
Java :: center justify jlabel 
Java :: dialog getWindow().setBackgroundDrawable transparent 
Java :: java random 6 digit number 
Java :: convert string to int java 
Java :: java remove non numbers from string 
Java :: print up to 2 decimal in java 
Java :: jframe add label java 
Java :: java create list with initial elements 
Java :: HTTP FAILED: java.net.UnknownServiceException: CLEARTEXT communication to ztdev.co.za not permitted by network security policy 
Java :: dialog with edittext android 
Java :: sleep for milliseconds in java 
Java :: how to print elements in matrix java 
Java :: jakkala siva venkata deepesh 
Java :: java ee schedule every 10 seconds 
Java :: java replace all space with underscore 
Java :: append to file in java 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =