Making phone ring and vibrate?

rfresh

Well-Known Member
Licensed User
Longtime User
I'm using the commands

B4X:
p.SetRingerMode(p.RINGER_NORMAL)
p.SetRingerMode(p.RINGER_VIBRATE)

respectively to make my phone ring or vibrate, but how would I make it ring and vibrate at the same time? I can't set both of these parameters at the same time right?

Thanks...
 

genesi

Active Member
Licensed User
Longtime User
you should open a new thread ;)
From Wiki
B4X:
Sub Process_Globals
   Dim Vibrate As PhoneVibrate ' For phone vibration
End Sub
Sub Button_Click
   Vibrate.Vibrate (50) ' Vibrate phone for 50 ms
   ...
End Sub
Mario
 
Upvote 0

wheretheidivides

Active Member
Licensed User
Longtime User
So for the newbees (like me), you have to also add the library 'phone' into your projrct.

1) From IDE click on 'libs' at bottom right od screen.
2) checkmark the 'phone'

When you do you will see the red code 'vibrate' turn blue (coorect color).
 
Upvote 0
Top