Determining When to Use Services - Android

A service within the Android Software Development Kit (SDK) can mean one of two things. First, a service can mean a background process, performing some useful operation at regular intervals. Second, a service can be an interface for a remote object, called from within your application. In both cases, the service object extends the Service class from the Android SDK, and it can be a stand-alone component or part of an application with a complete user interface.

Certainly, not all applications require or use services. However, you might want to consider a service if your application meets certain criteria, such as the following:

  • The application performs lengthy or resource-intensive processing that does not require input from the user.
  • The application must perform certain functions routinely, or at regular intervals, such as uploading or downloading fresh content or logging the current location.
  • The application performs a lengthy operation that, if cancelled because the application exits, would be wasteful to restart. An example of this is downloading large files.
  • The application needs to expose and provide data or information services (think web services) to other Android applications without the need of a user interface.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Android Topics