Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Work, Work - WorkManager
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
170
Modern Android dependency injection
hugovisser
1
300
Android dependency injection in 2022
hugovisser
1
260
Open the door!
hugovisser
0
92
Navigating the Navigation Component
hugovisser
1
200
Reactive UIs with Data Binding
hugovisser
2
190
Up close and personal with Nearby (DevFest Trondheim)
hugovisser
0
130
Up close and personal with Nearby
hugovisser
3
520
Room: the blessed object mapper
hugovisser
0
240
Other Decks in Technology
See All in Technology
[dbts2026]数十PBの超巨大データ×AI活用を支えるSnowflakeの実力〜大規模環境におけるアーキテクチャと運用のリアル〜
y_matsubara
0
130
Microsoft Entra Kerberos で実現するクラウド デバイス管理
tamaiyutaro
2
660
アラートを見直していたら営業組織への理解にちょっとだけ繋がった話
z63d
0
150
狙われているAPIの脆弱性!今こそ手をつけるべき根本的な対策とは?
nagix
0
110
AWS Quick 入門 | 目指せ Quick マスター 01
inariku
PRO
2
280
顧客合意を取りながら進めるAWSコスト削減の実践
optim
0
160
GCASアップデート(202607-202610)
techniczna
1
250
並列度を下げたら速くなった — go build の重複コンパイルを実測で見る
tomoaki25
2
1k
MCPでAIが自分で調べに行く
cdataj
0
130
DBTS2026 盛り上がってますか!?Databricksが実現するAI時代のデータ基盤
akuwano
1
200
大江戸Ruby会議でデータベース クライアントの話をするのは 間違っているだろうか
yahonda
1
110
The Author Pays
hiccupps
0
150
Featured
See All Featured
Faster Mobile Websites
deanohume
310
32k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
840
How Software Deployment tools have changed in the past 20 years
geshan
3
35k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
300
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
520
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
121
130k
Balancing Empowerment & Direction
lara
6
1.4k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.2k
Statistics for Hackers
jakevdp
799
230k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.8k
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