Long running background services were once strongly recommended against
by the Android developer docs. I can no longer find the article that
stated that, though.
In any case, using a Service to perform API calls is a bit heavy handed.
The actual request was performed in an AsyncTask inside the Service
anyway. All it really did was add an extra layer of complexity:
An Intent had to be created to start the service.
Arguments were serialized and unserialized.
Retrying dead events required Activities to bind to the service and
use interprocess communication.
Additionally, ApiService was kept alive and running for weeks after the
app was closed unless the user explicitly killed the app.
Converting ApiService to a class with static methods only resulted in
simplifications and performance improvements. One motiviation to use a
Service was to use it to download guides for offline storage. The backup
framework already has a nice system for handling that so it would only
cause problems to try and use ApiService to do the background work.
Long running background services were once strongly recommended against by the Android developer docs. I can no longer find the article that stated that, though.
In any case, using a Service to perform API calls is a bit heavy handed. The actual request was performed in an AsyncTask inside the Service anyway. All it really did was add an extra layer of complexity:
Additionally, ApiService was kept alive and running for weeks after the app was closed unless the user explicitly killed the app.
Converting ApiService to a class with static methods only resulted in simplifications and performance improvements. One motiviation to use a Service was to use it to download guides for offline storage. The backup framework already has a nice system for handling that so it would only cause problems to try and use ApiService to do the background work.