Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Work, Work - WorkManager
Search
Hugo Visser
July 19, 2018
Technology
0
75
Work, Work - WorkManager
Slided from my presentation on WorkManager at the DutchAUG IO Extended Extended meetup.
Hugo Visser
July 19, 2018
Tweet
Share
More Decks by Hugo Visser
See All by Hugo Visser
LLMs on Small devices [DutchAUG]
hugovisser
1
120
Modern Android dependency injection
hugovisser
1
260
Android dependency injection in 2022
hugovisser
1
180
Open the door!
hugovisser
0
58
Navigating the Navigation Component
hugovisser
1
140
Reactive UIs with Data Binding
hugovisser
2
150
Up close and personal with Nearby (DevFest Trondheim)
hugovisser
0
85
Up close and personal with Nearby
hugovisser
3
490
Room: the blessed object mapper
hugovisser
0
200
Other Decks in Technology
See All in Technology
非CUDAの悲哀 〜Claude Code と挑んだ image to 3D “Hunyuan3D”を EVO-X2(Ryzen AI Max+395)で動作させるチャレンジ〜
hawkymisc
2
190
「図面」から「法則」へ 〜メタ視点で読み解く現代のソフトウェアアーキテクチャ〜
scova0731
0
210
[デモです] NotebookLM で作ったスライドの例
kongmingstrap
0
150
AWS re:Invent 2025で見たGrafana最新機能の紹介
hamadakoji
0
390
大企業でもできる!ボトムアップで拡大させるプラットフォームの作り方
findy_eventslides
1
780
Sansanが実践する Platform EngineeringとSREの協創
sansantech
PRO
2
870
グレートファイアウォールを自宅に建てよう
ctes091x
0
150
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
年間40件以上の登壇を続けて見えた「本当の発信力」/ 20251213 Masaki Okuda
shift_evolve
PRO
1
130
SREには開発組織全体で向き合う
koh_naga
0
330
re:Invent2025 コンテナ系アップデート振り返り(+CloudWatchログのアップデート紹介)
masukawa
0
370
品質のための共通認識
kakehashi
PRO
3
260
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
710
Documentation Writing (for coders)
carmenintech
76
5.2k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Building an army of robots
kneath
306
46k
Bash Introduction
62gerente
615
210k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
The Cult of Friendly URLs
andyhume
79
6.7k
Being A Developer After 40
akosma
91
590k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
100
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
Transcript
Work, work - WorkManager Hugo Visser @botteaap
[email protected]
None
None
WorkManager Part of architecture components, JetPack Schedules & execute jobs
“...intended for tasks that require a guarantee that the system will run them even if the app exits…”
Current options AlarmManager JobScheduler GCMNetworkManager FirebaseJobDispatcher
Current options AlarmManager → No system coordination, no constraints, throttled
JobScheduler GCMNetworkManager FirebaseJobDispatcher
Current options AlarmManager → No system coordination, no constraints, no
retries, throttled JobScheduler → API 21+, Coordination, constraints & retries, bugs < API 23 GCMNetworkManager FirebaseJobDispatcher
Current options AlarmManager → No system coordination, no constraints, no
retries, throttled JobScheduler → API 21+, Coordination, constraints & retries, bugs < API 23 GCMNetworkManager → JobSchedulerCompat, but not quite FirebaseJobDispatcher
Current options AlarmManager → No system coordination, no constraints, no
retries, throttled JobScheduler → API 21+, Coordination, constraints & retries, bugs < API 23 GCMNetworkManager → JobSchedulerCompat, but not quite FirebaseJobDispatcher → Pluggable schedulers, default: GCMNetworkManager
WorkManager Schedule jobs using constraints & retries JobScheduler on API
23+ AlarmManager or GCMNetworkManager through FJD < API 23
New features Reduce IPC → if a job is eligible
to run immediately, no need to “schedule” it. Monitor status → LiveData providing job status Unique jobs Tags Output parameters Orchestration of multiple jobs
Orchestration B runs after A D runs after C E
runs after B and D are completed
Unit of work: Worker import androidx.work.Worker class MyWorker: Worker() {
override fun doWork(): Result { // do the hard work return Result.SUCCESS // or Result.FAILURE or Result.RETRY } }
Schedule // work-runtime-ktx gives us a nicer kotlin syntax val
request = OneTimeWorkRequestBuilder<MyWorker>() .setConstraints(Constraints.Builder() .setRequiredNetworkType(NetworkType.CONNECTED) .build()) .build() // as of alpha4 getInstance() can return null! WorkManager.getInstance()!!.enqueue(request)
Monitor val status = WorkManager.getInstance()!!.getStatusById(request.id) status.observe(this, Observer { // WorkStatus
can be null if the task id is invalid or gone it?.let { Log.d(TAG, "Task status: ${it.state}") } })
Next? API still in flux Asynchronous workers Try it out,
file bugs https://issuetracker.google.com https://developer.android.com/topic/libraries/architecture/workmanager
Thanks! @botteaap
[email protected]
speakerdeck.com/hugovisser