VibrateDevice()

Just starting out? Need help? Post your questions and find answers here.
falsam
Posts: 280
Joined: Mon May 05, 2014 9:49 pm
Location: France
Contact:

VibrateDevice()

Post 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

➽ Windows 11 - JDK 1.8 - SB 2.40 - Android 13
http://falsam.com

Sorry for my poor english
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: VibrateDevice()

Post 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
Post Reply