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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Hugo Visser
July 19, 2018
Technology
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Work, Work - WorkManager
Slided from my presentation on WorkManager at the DutchAUG IO Extended Extended meetup.
Hugo Visser
July 19, 2018
More Decks by Hugo Visser
See All by Hugo Visser
LLMs on Small devices [DutchAUG]
hugovisser
1
160
Modern Android dependency injection
hugovisser
1
290
Android dependency injection in 2022
hugovisser
1
240
Open the door!
hugovisser
0
84
Navigating the Navigation Component
hugovisser
1
180
Reactive UIs with Data Binding
hugovisser
2
180
Up close and personal with Nearby (DevFest Trondheim)
hugovisser
0
120
Up close and personal with Nearby
hugovisser
3
510
Room: the blessed object mapper
hugovisser
0
220
Other Decks in Technology
See All in Technology
AIエージェントの開発・提供におけるセキュリティリスクの論点と対策
flatt_security
1
460
【視聴者参加型!】AWSセキュリティアンチパターンクイズ
syoshie
0
130
プロダクトエンジニアに必要な「いい感じ」に作る能力 〜たくさん作れる時代に、どこまで作るかの決め方〜
jnishime_dresscode
2
1k
20260906 「AWS運用入門」著者が教える、運用業務への生成AI活用入門
masaruogura
0
180
When Does a Local Qwen Start to Break
morshoto
0
150
AIエージェントを雇う前に決める5つのこと
knishioka
1
150
[RSJ26] Flow as Flow: Modeling Robot Velocity Fields as Probability Velocity Fields
keio_smilab
PRO
0
180
AIで実装は速くなった。なのにプロダクトは速くならない。職能の壁を越えて価値のフローを設計する
nwiizo
5
5.7k
Bet AI Day 2026丨Agentは、「金融」という巨大産業の何を変えられるのか
layerx
PRO
0
610
Webとヘルスデータ
yukukotani
0
140
どんな手を使っても絶対間に合わせるスケジューラ
asari194617
0
1.5k
AI時代に、プロダクトの数だけ積み上がる所有コストをどうエンジニアリングするか / Engineering the Cost of Ownership
kzkmaeda
0
760
Featured
See All Featured
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
320
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
400
Test your architecture with Archunit
thirion
2
2.4k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
800
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
180
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Scaling GitHub
holman
464
140k
Done Done
chrislema
186
16k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
290
How to make the Groovebox
asonas
2
2.4k
Navigating Weather and Climate Data
rabernat
0
510
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