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
Skyrocket your performance with background tasks
Search
Myracle
June 27, 2020
Programming
0
74
Skyrocket your performance with background tasks
My talk at Flutter Day India 2020 - Isolates - Background Tasks with Workmanager
Myracle
June 27, 2020
Tweet
Share
Other Decks in Programming
See All in Programming
AIを活用し、今後に備えるための技術知識 / Basic Knowledge to Utilize AI
kishida
22
5.9k
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
250
Testing Trophyは叫ばない
toms74209200
0
890
プロパティベーステストによるUIテスト: LLMによるプロパティ定義生成でエッジケースを捉える
tetta_pdnt
0
4.4k
個人軟體時代
ethanhuang13
0
330
@Environment(\.keyPath)那么好我不允许你们不知道! / atEnvironment keyPath is so good and you should know it!
lovee
0
130
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
130
Improving my own Ruby thereafter
sisshiki1969
1
160
The Past, Present, and Future of Enterprise Java with ASF in the Middle
ivargrimstad
0
190
rage against annotate_predecessor
junk0612
0
170
testingを眺める
matumoto
1
140
「待たせ上手」なスケルトンスクリーン、 そのUXの裏側
teamlab
PRO
0
600
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
113
20k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
GraphQLの誤解/rethinking-graphql
sonatard
72
11k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Building an army of robots
kneath
306
46k
Designing for humans not robots
tammielis
253
25k
Facilitating Awesome Meetings
lara
55
6.5k
How to train your dragon (web standard)
notwaldorf
96
6.2k
A Modern Web Designer's Workflow
chriscoyier
696
190k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
3k
Mobile First: as difficult as doing things right
swwweet
224
9.9k
Transcript
Skyrocket your performance with Background Tasks MAX WEBER – FLUTTER
DAY INDIA 2020
About Me u Founder of FlutterExplained u Software Engineer u
Consultant u Trainer u Public Speaker @flutter_exp FlutterExplained
Intro into Background Tasks u Long Running Tasks besides of
Flutter u Your app is currently not active but performs tasks u Two different “background” states u Background State u “Destroyed” State
Isolates u Isolate is a contained instance of Dart u
It has its own uEvent Loop uMemory
Overview
We start easy…
Create an Isolate
None
Helper: compute Function u Compute is a helper function u
Creates an Isolate and runs in background u Less boilerplate u Returns a value u Limited Functionality
Isolates work fine… For apps that are in background Performs
heavy calculation tasks Allow Multi thread in Dart Speed up your applications! but… Stops when FlutterActivity is destroyed
App suspended, what now? u Plugins to the rescue u
Native Device Code starts up Flutter Engine u Runs our Dart Code u Downsides u Super code heavy u Native Code u No / Few Documentation
Documentation
Background Behavior Android u AlarmManager u JobService u Firebase Job
Dispatcher u WorkManager iOS u Minimum background fetch interval u iOS could decide never execute our code
Workmanager Package u Facilitates the u Android WorkManager u iOS
performFetchWithCompletionHandler u Reduces installation effort to a minimum u No Native Code in Kotlin or Swift
Setup WorkManager
None
CallbackDispatcher (Isolate)
Conclusion u Isolates u improve your apps performance u Careful
with “overengineering” u Background Tasks u iOS and Android have different approaches u Both are not perfectly flexible u Recommendation to use a package
Ressources u https://medium.com/vrt-digital-studio/flutter-workmanager-81e0cfbd6f6e u https://medium.com/flutter/executing-dart-in-the-background-with- flutter-plugins-and-geofencing-2b3e40a1a124 u https://flutter.dev/docs/development/packages-and-plugins/developing- packages u
https://medium.com/stuart-engineering/keep-flutter-running-background- on-android-6ffc85be0234 u https://pub.dev/packages/workmanager
” “ Thank you