user2489696
user2489696

Reputation: 91

bind to service vs Intent base communication

I have found that it is possible to communicate with services by use of either Intents or direct binding . Why should direct binding could be useful ? and isn't it a bad practice that sounds like high coupling with components ?

Upvotes: 6

Views: 1716

Answers (1)

khubaib
khubaib

Reputation: 535

Usually a service which is started with context.StartService() with intents performs a single operation and does not return a result to the caller.and this service can run indefinitely and the service should stop itself by calling stopSelf().

Where as bounded service offers a client server interface that allows components to interact with the service and send requests,get results and even do so across processes with inter process communication(IPC).One or more component can bound to this service.this service run only till at least a component is binded to it else it is destroyed(stopd).

want to know more on bounded and unbounded services. Please refer the below link

Bounded and unbounded services

Upvotes: 3

Related Questions