Currently (end of 2013) there are better solutions for getting a link to a working service in Android, just use a library, for example Otto or EventBus .
Add eventbus to your activity and service, implement the onEvent() method on both sides, create one or two classes xyzEvent ( xyz = the name of your event), register references to the activity and service in eventbus ('this').
Send an event to the service from your activity on eventbus, catch it in the onEvent method of your service, publish a new event in response to the activity, catch it in the onEvent method of your activity: now you have a help desk ( this service) available as part of this operation .
Everything is set up and done without any fuss. Activity and maintenance are fairly untied and easy to implement. There is nothing special about this. No direct binding, no messengers, no AIDL. Only the old-fashioned K.I.S. principle.
Now you have a link to your service from your activity and you can call any direct method available in the service.
source share