This document discusses Android services, which are long-running background processes that can perform operations without a user interface. Services can be started or bound to by other application components and have a lifecycle managed through callback methods. Common service types include regular services, intent services, and foreground services. Services provide functionality to applications and allow work to continue in the background independently of activities.
10. StartService
start by other Application Component
(such like Activity, Service..) who calling
startService
destroy by calling stopService() or
stopSelf()
11. BindService
bind when Application Component
calling bindService()
unbind when calling unbindService()
provide IBinder to interact with other
component
when none is bind, the service destroy
14. onStartCommand()
when Service is start by calling
startService(), onStartCommand will be
called
the Service will indefinitely running
you have to call stopSelf() or
stopService() to destroy Service
16. onBind()
help to bind Service and other
Application Component by
ServiceConnection
return a IBinder instance to interact
with other Component
return null to not allow binding
29. Foreground Service
more actively aware
less opportunity to been killed
startForeground() bind with an
Notification for the status bar to
interact with the user
like music player