Page 1 of 1

VibrateDevice()

Posted: Wed Mar 21, 2018 2:11 pm
by falsam
■ SB 2.20 - Android 5.1

I think the VibrateDevice() function doesn't work with Android.

I created an APK with this code ...

Code: Select all

Enumeration
  #mf
EndEnumeration

Declare Start()
Declare Vibrate()

Start()

Procedure Start()  
  OpenWindow(#mf, 0, 0, 0, 0, "Vibrate", #PB_Window_Background)
  AddWindowTimer(#mf, 0, 5000)
  Debug "Wait 5 seconds  ..."
  
  BindEvent(#PB_Event_Timer, @Vibrate())  
EndProcedure

Procedure Vibrate()
  Debug "Vibrate 3 seconds"
  VibrateDevice(3000)  
EndProcedure

Re: VibrateDevice()

Posted: Sun Jan 27, 2019 1:45 pm
by Fred
You need to click at least once in the app to enable it. If you write a game, jus add a start button and it should do the trick.

More info:

https://www.chromestatus.com/feature/5644273861001216