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

VibrateDevice()

by falsam Wed Mar 21, 2018 2:11 pm

■ 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 10 - JDK 1.8 - SB 2.20 - Android 5.5
http://falsam.com

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

Re: VibrateDevice()

by Fred Sun Jan 27, 2019 1:45 pm

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
Return to Coding Questions

Who is online

Users browsing this forum: No registered users and 3 guests