hookshy Well-Known Member Licensed User Longtime User May 3, 2015 #1 Q: Is there a way to detect if the vibration is turned off by the user or not supported ? Thank you
Erel B4X founder Staff member Licensed User Longtime User May 3, 2015 #2 On Android 4+ you can use this code to check whether this feature is available: Code: Copy Private Sub HasVibrator As Boolean Dim jo As JavaObject jo.InitializeContext Dim p As Phone If p.SdkVersion < 12 Then Return True Return jo.RunMethodJO("getSystemService", Array("vibrator")).RunMethod("hasVibrator", Null) End Sub Upvote 0
On Android 4+ you can use this code to check whether this feature is available: Code: Copy Private Sub HasVibrator As Boolean Dim jo As JavaObject jo.InitializeContext Dim p As Phone If p.SdkVersion < 12 Then Return True Return jo.RunMethodJO("getSystemService", Array("vibrator")).RunMethod("hasVibrator", Null) End Sub