I want to say to my Android device that it should make a very short vibration. I know that I have to write a Livecode Builder library which seems to be easy. BUT now I have the problem to transform some Java code I have found into the correct foreign handler.
Here is the Java code which seems to do what I want:
Code: Select all
// Get instance of Vibrator from current Context
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
// Vibrate for 4100 milliseconds
v.vibrate(VibrationEffect.createOneShot(100, VibrationEffect.DEFAULT_AMPLITUDE));
https://livecode.fandom.com/wiki/Foreig ... gs_to_Java
Binding to a class constructor with parameters:
Code: Select all
foreign handler CreateJavaString(in pBytes as JByteArray) returns JString binds to "java:java.lang.String>new([B)"
Cheers,
Torsten