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
61
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
Goのmultiple errorsについて (2024年4月版)
syumai
3
710
今、知っておきたい! 生成AIエージェントの世界
elith
3
360
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
170
VSCodeでのDatabricks開発もお勧めしたい/I would also recommend Databricks development with VSCode.
kazumain
0
250
エンターテイメント業界で利用されるAWS
demuyan
0
210
Hanami and htmx
bkuhlmann
0
210
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
840
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
370
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
780
Let's learn code review
riofujimon
1
260
Snowflakeで眠ったデータを起こそう!
estie
0
120
Elm Form Validation
bkuhlmann
0
510
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
37
2.5k
Thoughts on Productivity
jonyablonski
58
3.8k
Docker and Python
trallard
34
2.7k
Visualization
eitanlees
136
14k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
BBQ
matthewcrist
80
8.8k
Building a Scalable Design System with Sketch
lauravandoore
456
32k
How to train your dragon (web standard)
notwaldorf
73
5.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
2
1.3k
Building Your Own Lightsaber
phodgson
99
5.7k
Optimizing for Happiness
mojombo
370
69k
Creatively Recalculating Your Daily Design Routine
revolveconf
210
11k
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