I am developing an application that checks several conditions during an incoming phone call. The main parts of the application are BroadcastReceiver, which listens to intentions related to the state of the phone, and a local service that checks the conditions.
Currently, the service starts every time an incoming call is detected, and stops when the phone status returns to standby mode.
Now I wonder if this procedure is correct and whether it is advisable to start and stop the service related to the state of the phone. Or it would be better to let the service work regardless of the state of the phone and tie / untie it / out of it when necessary.
Are there any performance issues I'd have to think about? It may be more expensive to start / stop a service than to let it work and communicate with it. Are there any best practices for implementing services?
android service
Flo
source share