I would suggest that your billing service be received from IntentService, so that it starts / stops automatically when necessary. You start it using startService (Intent), and then when it finishes, it will shut down. IntentService also provides a built-in queue, so only one intention will be processed immediately, as well as its own workflow.
As I recall, you also need a receiver to use the IAB, which can then call the service using Intent and set the action based on what needs to be done.
source share