Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

android vibrate device

import android.os.Vibrator;
...
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
// Vibrate for 500 milliseconds
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
    v.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE));
} else {
    //deprecated in API 26 
    v.vibrate(500);
}
Comment

PREVIOUS NEXT
Code Example
Java :: java sort list 
Java :: display an image java 
Java :: object to double java 
Java :: java int to biginteger 
Java :: get random word from array java 
Java :: java jpa criteriabuilder in xample 
Java :: array to arraylist java 
Java :: java get classname 
Java :: play sound in java 
Java :: java long to int 
Java :: change javahome cmd 
Java :: area of circle in java 
Java :: java how to print a string[] 
Java :: java import text file into arraylist 
Java :: java export image 
Java :: jframe set visibility 
Java :: bigdecimal to string 
Java :: java jframe actionlistener 
Java :: qr code generator in java 
Java :: java separate the numbers from string 
Java :: java hashmap key exists 
Java :: get time android 
Java :: java iso 8601 format 
Java :: date difference in minutes java 
Java :: string to byte array java 
Java :: java get date in utc 
Java :: James Gosling 
Java :: modal css react 
Java :: print list array 
Java :: send whatsapp message java android studio 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =