I looked through all the posts about it in here and in android documentation about service. I still can't understand how to do it.
I want to write application that collects battery data all the time event when the UI is closed. I found that I need to use a service for this with BindService & StrartService so the UI Activity could communicate with the service and the service could also run by it self in case the UI activity closes.
The thing that I can't understand is how do I make the service run "forerver" even when I close it with android app manager. For example: Whatsapp application even if I close it with the app manager in the moment that someone sends me a message I still get it and whatsapp turns on.
Do I need to use thread (runnable interface with run function) or what?