I have an application which connects to a BLE emergency button and reacts to an alarm the button is sending. (e.g. making a HTTP-request) The application starts a scan by clicking on a button and shows the results in a listview. After clicking on an item of the listview the application connects to the selected device (button).
The problem is that I don't know how I should run the rest of the app in background.
I found this article and came to the conclusion that a foregroundservice would make sense. The notification could show if the device is connected or not.
My question is if my conclusion makes sense or if I should use something else and if yes what.