Sometimes you want to have an Android service to run independent of the lifecycle of you Activities and application. This is convenient when you need to have background logic.

For example I’ve built an application that measures the usage of the phone. The app listens for screen events and updates a shared database. This could not be solved without an background service that runs continuously in background with an registered screen state receiver.

When starting an service in background you need to inform the user about that you app has something started and running. This is done by adding information to the Android notification bar – in this way the user is notified what apps are running.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.

Menu