Started service

As described previously, a started Service is a service that is initiated when the Context method startService() is invoked by any entity on the system that has access to a Context object or is a Context itself, such as an Activity:

         ComponentName startService(Intent service)

Note

An Intent is a messaging object that can carry data (action, category, extras, and so on) and that you can use to request an action from another Android component.

The startService() function basically starts a service with an intent, and returns to the user a component name that can be used to verify that the correct service was resolved and invoked.

To simplify the Service resolution, we pass an Intent created from the current context with the Service class ...

Get Asynchronous Android Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.