Android Question Connecting to a BLE device doesn't work when screen off.

jimseng

Active Member
Licensed User
Longtime User
I am connecting to a watch via BLE with a b4xpages app. I am trying to use the phone as a gateway between the watch and a server. Watch --> BLE --> phone --> internet --> server
This seems to work and I have the BLE connection as a service and I can still send data to my server via the phone when the phone goes to sleep.
The issue I am having is that if I were to lose the BLE connection I have to wake the screen up in order to re connect to the phone. It appears I don't need to actually unlock the phone, just turn the screen on:
B4X:
dim pws as PhoneWakeState
pws.KeepAlive(True)
However this is going to be very expensive in battery. Am I stuck or is there something I can do to make it work without having to turn the screen on.
 

teddybear

Well-Known Member
Licensed User
An alternative solution,Set the brightness to the lowest level.
 
Upvote 0
Top