iFixit/iFixitAndroid — pull request #170 by marczych (2013-12-08 23:49:15+00:00)
Title: API: Use an AsyncTask rather than a Service

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:

1. An Intent had to be created to start the service.
1. Arguments were serialized and unserialized.
1. 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.