Friday, 21 November 2014

What is Service and its types in Android ?

1- Service is a component which doesn't have any UI.

2- It runs in Background.

3- It can Update UI elements ( UI elements of the application which is currently using the service ).

4- Services allow to share functionality among applications without creating physical copy of class.

There are two types of Services in Android :

1- Bound:

The services which is work for specific activity or application called Bound Service.

2- Unbound:

The Service which is continously running or system provides services called Unbound Service.

If we go through Life Cycle of Bound and Unbound Services,the methods are:


i) onCreate()
ii) onBind()
iii) onUnbind()
iv) onDestroy()


i) onCreate()
ii) onStartCommand()
iii) onDestroy()

To know this concept in Brief , see below link

No comments:

Post a Comment