Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Work, Work - WorkManager
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Hugo Visser
July 19, 2018
Technology
0
89
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
130
Modern Android dependency injection
hugovisser
1
270
Android dependency injection in 2022
hugovisser
1
200
Open the door!
hugovisser
0
71
Navigating the Navigation Component
hugovisser
1
150
Reactive UIs with Data Binding
hugovisser
2
160
Up close and personal with Nearby (DevFest Trondheim)
hugovisser
0
96
Up close and personal with Nearby
hugovisser
3
500
Room: the blessed object mapper
hugovisser
0
210
Other Decks in Technology
See All in Technology
Ultra Ethernet (UEC) v1.0 仕様概説
markunet
3
200
LLM活用の壁を超える:リクルートR&Dの戦略と打ち手
recruitengineers
PRO
1
240
生成AI活用によるPRレビュー改善の歩み
lycorptech_jp
PRO
5
2k
Lookerの最新バージョンv26.2がやばい話
waiwai2111
1
150
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
72k
Evolution of Claude Code & How to use features
oikon48
0
100
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
7
7.1k
「ストレッチゾーンに挑戦し続ける」ことって難しくないですか? メンバーの持続的成長を支えるEMの環境設計
sansantech
PRO
1
310
Secure Boot 2026 - Aggiornamento dei certificati UEFI e piano di adozione in azienda
memiug
0
140
OpenClawで回す組織運営
jacopen
2
290
パネルディスカッション資料 (at Tableau Now! - 2026-02-26)
yoshitakaarakawa
0
1.1k
Oracle Cloud Infrastructure:2026年2月度サービス・アップデート
oracle4engineer
PRO
0
220
Featured
See All Featured
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
240
We Have a Design System, Now What?
morganepeng
55
8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
120
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
1.9k
エンジニアに許された特別な時間の終わり
watany
106
240k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.1k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Test your architecture with Archunit
thirion
1
2.2k
Utilizing Notion as your number one productivity tool
mfonobong
4
240
How to build a perfect <img>
jonoalderson
1
5.2k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
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