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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Hugo Visser
July 19, 2018
Technology
0
83
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
260
Android dependency injection in 2022
hugovisser
1
200
Open the door!
hugovisser
0
67
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
93
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
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
3
420
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
(金融庁共催)第4回金融データ活用チャレンジ勉強会資料
takumimukaiyama
0
130
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1.2k
使いにくいの壁を突破する
sansantech
PRO
1
120
GCASアップデート(202510-202601)
techniczna
0
250
Digitization部 紹介資料
sansan33
PRO
1
6.8k
Mosaic AI Gatewayでコーディングエージェントを配るための運用Tips / JEDAI 2026 新春 Meetup! AIコーディング特集
genda
0
150
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.3k
2人で作ったAIダッシュボードが、開発組織の次の一手を照らした話― Cursor × SpecKit × 可視化の実践 ― Qiita AI Summit
noalisaai
1
370
GitLab Duo Agent Platform × AGENTS.md で実現するSpec-Driven Development / GitLab Duo Agent Platform × AGENTS.md
n11sh1
0
120
データの整合性を保ちたいだけなんだ
shoheimitani
8
2.9k
Featured
See All Featured
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.9k
Scaling GitHub
holman
464
140k
Optimising Largest Contentful Paint
csswizardry
37
3.6k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
The Invisible Side of Design
smashingmag
302
51k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
88
Code Review Best Practice
trishagee
74
20k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
770
Building Flexible Design Systems
yeseniaperezcruz
330
40k
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
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