WorkManager for Immediate Tasks

Sometimes it’s best to execute right away

Siva Ganesh Kantamani
Programming Geeks

--

Takeaway from this article

This blog post focus on how to implement long-running background tasks that need to start immediately with WorkManager. You need to be familiar with the basics of WorkManager before going any further, so I would recommend learning from here.

Overview

One thing that is constantly changing in the android environment is how we handle background tasks. When the number of apps increased in the phone, the number of background tasks will also increase; most of the apps won’t check for battery health before starting their job, which leads to drain the battery in a short time.

WorkManager is a jetpack library to help developers execute their long-running background tasks in the best way possible without affecting system health.

WorkManager is:

  • Compatible with API level 14
  • Runs with/without Google Play Services

How WorkManager execute background tasks?

When we add a request to the WorkManager queue, we also add constraints(requirements to execute your request, such as network connection).

--

--