Auto connect to a known BLE device

I know that setting autoConnect to true in connectGatt will not reconnect to my device if I exit and again end up in the range with a large time interval between them. My question is, how can I connect without supporting android and not kill the battery?

+6
source share
1 answer

I think that my decision on a similar question (to me) can help. Just save the MAC address of the BLE device to the database or something else, and connect using the MAC address when necessary. You can call connectGatt() periodically when the application starts or when it initializes something.

0
source

Source: https://habr.com/ru/post/985418/


All Articles