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 :: kill all java processes linux 
Java :: java how to find the largest number in an arraylist 
Java :: how to scan a string in java 
Java :: scanner check if int 
Java :: select word from list 
Java :: int to enum java 
Java :: byte to bufferedimage java 
Java :: println java 
Java :: java convert integer to string 
Java :: sort 2d array by column java 
Java :: how to read a json file in java 
Java :: how to create a circle in java 
Java :: java get variable from another class 
Java :: sorting an arraylist 
Java :: Spring boot fix cors problem 
Java :: set visible gui java 
Java :: remove spaces at beginning and end of string java 
Java :: change button text onclick java 
Java :: check instance of java 
Java :: enum to int java 
Java :: Java Scanner nextLine() 
Java :: android checkbox tint color 
Java :: Java Stack class pop() method 
Java :: android studio change menu title 
Java :: nested for each loop java 
Java :: difference between access specifiers and access modifiers in java 
Java :: Who made java ? 
Java :: java quotes in string 
Java :: string to char in java 
Java :: activitycompat.requestpermissions not working 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =