Find the best answer to your question, help others answer theirs

If you are going to use a passage of Lorem Ipsum, you need to be sure there
isn't anything embarrassing hidden in the middle of text.

  • Anybody can ask a question
  • Anybody can answer
  • The best answers are voted up and rise to the top
What is Android Bound Service?
Asked 5 वर्ष पहले
Viewed 600 times

1 Answer

2

A bound service is a service that allows other android components (like activity) to bind to it and send and receive data. A bound service is a service that can be used not only by components running in the same process as local service, but activities and services, running in different processes, can bind to it and send and receive data.

When implementing a bound service we have to extend Service class but we have to override onBind method too. This method returns an object that implements IBinder, that can be used to interact with the service.

Implementing Android bound service with Android Messenger

Service based on Messenger can communicate with other components in different processes, known as Inter Process Communication (IPC), without using AIDL.

A service handler: this component handles incoming requests from clients that interact with the service itself.

A Messenger: this class is used to create an object implementing IBinder interface so that a client can interact with the service.

Edit
avatar
Majed Badawi
15.5k 3 10 26
answered 8 hours ago

Leave a Comment

[named hyperlinks] (https://example.com)
**bold**
_italic_

Your Answer

Drop files here or click to upload.