Creating the service

The heart of the Android portion of the project is our REST endpoints. We would like these endpoints to be available whenever the phone is on, so we can't use an Activity to host them. What we want is a Service. The Android documentation defines a Service as an application component that can perform long-running operations in the background, and it does not provide a user interface. There are three types of Services--scheduled (which runs on a schedule), started (which can be started explicitly by another application component), and bound (which is bound to an application component via the bindService() call, and runs until all the bound components are destroyed). Since we want this to be available all the time, we want ...

Get Java 9: Building Robust Modular Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.