bluetooth lowenergy - Android notification when BLE device discovered -


we working on android app makes gatt connection ble devices , writes characteristics. our current approach scan devices (startlescan on android 4.3 , 4.4. devices , startscan on android 5.0+) every few seconds , connect device when discovered.

this solution works drains lot of battery because need keep wake locks (or trigger alarm manager every few seconds) scanning work when phone in sleep.

is there way android can notify app when ble device discovered instead of continuously scanning devices?

ios app works great because ios wakes app in background when there ble device nearby, saves lot of battery. wondering there similar on android keep battery under acceptable limit.

just reference, have tried alt-beacon library found internally usages alarm manager , if set alarm manager trigger every 5 seconds, consumes 7-8% battery every hour.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -