Answer the question
In order to leave comments, you need to log in
How to make a long-lived Foreground Service on Android for BLE scanning?
I am working on an access control system based on a mobile application and a system of Bluetooth-Low-Energy (BLE) controllers. The task is this:
- to implement a "hands-free" mode, when the smartphone is in your pocket and in the background scans for BLE controllers (according to the RSSi level), while the smartphone does not need to be taken out to, say, open the doors controlled by one of the BLE -controller.
Technical requirements:
- scanning operation 1 time per 5 seconds
- work in DozeMode
- API-21 and higher.
Implementation thoughts:
1. use a combination of ForegroundService (for active mode) + FCM high-priority messaging (for DozeMode)
2. use Android apps white-list + ForegroundService.
Has anyone faced a similar problem?
Sincerely.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question