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 ...
Creating the service
Get Java 9: Building Robust Modular Applications 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.