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
コルーチン〜Androidと非同期処理〜
Search
nyafunta9858
November 15, 2022
Programming
850
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
コルーチン〜Androidと非同期処理〜
nyafunta9858
November 15, 2022
More Decks by nyafunta9858
See All by nyafunta9858
Explicit Backing Field にちょと詳しくなる
nyafunta9858
1
87
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
920
いまから追い上げる、Jetpack Compose トレーニング
nyafunta9858
1
3.1k
KotlinのLinterまなびなおし2024のホコウ
nyafunta9858
1
190
KotlinのLinter まなびなおし2024
nyafunta9858
4
6.4k
僕らが考える 最強のアーキテクチャについて 腹を割って話そう
nyafunta9858
0
260
もう迷わないCoroutines 〜suspend funとChannelとFlow〜
nyafunta9858
2
7.6k
Other Decks in Programming
See All in Programming
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
200
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
34k
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
120
AIに “答え“を書かせるのを やめてみた
___akari11
0
130
Vue Fes Japan の “作る側”に関わってみて
naokihaba
1
180
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
sbt 2.0: takeoff
eed3si9n
0
170
phperだってパンチカードでコーディングしたい
o0h
PRO
0
380
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
Performance Optimization With LLMs
xleitix
0
190
パスワード再設定メールのURLについて知っておこう
uyuki234
0
170
Featured
See All Featured
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
A Modern Web Designer's Workflow
chriscoyier
699
190k
30 Presentation Tips
portentint
PRO
1
430
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
First, design no harm
axbom
PRO
2
1.3k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
400
Everyday Curiosity
cassininazir
0
360
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
It's Worth the Effort
3n
188
29k
Un-Boring Meetings
codingconduct
0
460
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Transcript
コルーチン〜Androidと非同期処理〜
小林 慶弘 (Yoshihiro Kobayashi) a.k.a nyafunta9858 • Mobile Engineer •
2010年に組み込みソフトウェア開発を請け負う会社に新 卒で入社。これまでに様々な業種向けのtoC/toBtoCサー ビス開発に従事、ソフトウェア単体で動作するシステム 以外にもBLE機器や車載機をはじめとしたハードウェア 連携を要するシステム開発も多く経験。Androidには2系 の頃から触れ始める。 2022年3月にマネーフォワードへ 参画。ホームカンパニー プロダクト開発部に配属。マ ネーフォワードMEのAndroidアプリ開発を担当。 • 趣味:ガジェット集め、ゲーム、カメラ etc…
今日話すこと • コルーチンとは • コルーチンの推しポイント • まとめ
コルーチンとは • Android で使用できる並行実行のデザインパターン • 非同期実行するコードを簡略化できる • Kotlin 1.3 で追加されたものだが、すでに他の言語で確立されている概念をベースにしている
https://developer.android.com/kotlin/coroutines
今日のテーマについて • Androidの非同期処理は日々使いやすく進化している • コルーチンとの出会い、 1st class サポート • コルーチンの推しポイント
◦ ライフサイクルの考慮が簡単 ◦ スレッド管理・操作がシンプル ◦ 簡潔な記述 ◦ デバッグツール
ライフサイクルの考慮が簡単
ライフサイクル
ライフサイクル 手動でcancelが必要😥
ライフサイクル
ライフサイクル AAC ViewModelなどで使いにくい😥
ライフサイクル
ライフサイクル ライフサイクルに合わせて cancelされる😁
ライフサイクル シンプル + 考えることが 少なくなる👍👍👍
ちなみに...
スレッド管理・操作が シンプル
スレッド管理
スレッド管理 メインスレッドからの呼び出しが必要 😥
スレッド管理
スレッド管理
スレッド管理 CoroutineDispatcherを指定するだけ😁 スレッド管理もおまかせ👍👍👍
簡潔な記述
簡潔な記述
簡潔な記述
簡潔な記述 コード上は同期的 + ネストもなくなり 可読性向上👍👍👍
デバッグツール
デバッグ • kotlinx-coroutines-debug • Coroutine debugger https://www.jetbrains.com/help/idea/debug-kotlin-coroutines.html
まとめ
まとめ • Androidの非同期処理は日々使いやすく進化している • コルーチンとの出会い、 1st class サポート • コルーチンの推しポイント
◦ ライフサイクルの考慮が簡単 ◦ スレッド管理・操作がシンプル ◦ 簡潔な記述 ◦ デバッグツール
Join our team! We’re hiring! https://hrmos.co/pages/moneyforward/job s/0004133