Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

vibration android studio

// Get instance of Vibrator from current Context
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);

// Start without a delay
// Each element then alternates between vibrate, sleep, vibrate, sleep...
long[] pattern = {0, 100, 1000, 300, 200, 100, 500, 200, 100};

// The '-1' here means to vibrate once, as '-1' is out of bounds in the pattern array
v.vibrate(pattern, -1);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vibration #android #studio
ADD COMMENT
Topic
Name
6+2 =