Service first dene the interface that species how a

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ac0vity when you wish to perform opera0ons only while the user is interac0ng with the applica0on •  Declaring a service in the Manifest file: <manifest ... > ... <application ... > <service android:name=".ExampleService" /> ... </application> </manifest> COMP 4521 (Muppala) Interprocess Communication 6 Bound Service •  A bound service is the server in a client- server interface •  Allows components to bind to it by calling bindService() for long- standing connec0on •  Create a bound service –  To interact with the service from ac0vi0es and other components in your applica0on –  To expose some of your applica0on's func0onality to other applica0ons, through IPC COMP 4521 (Muppala) Interprocess Communication 7 Bound Service •  First, define the interface that specifies how a client can communicate with the service. –  Interface between the service and a client must be an implementa0on of IBinder •  Returned by the service to a client on the onBind() callback method •  Once the client receives the IBinder, it can interact with the service through that interface •  Mul0ple clients can bind to the service at once •  When a client is done interac0ng wit...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online