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...
 

jeronimovilar2

Member
Licensed User
Longtime User
How to vibrate?

I have a countdown-timer and i´d like to vibrate when the time is 0 (zero). How can i do?

sorry my english?
 
Upvote 0

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
Cookies are required to use this site. You must accept them to continue using the site. Learn more…