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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
58
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
870
いまから追い上げる、Jetpack Compose トレーニング
nyafunta9858
1
3k
KotlinのLinterまなびなおし2024のホコウ
nyafunta9858
1
180
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
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
520
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
330
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
140
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
380
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
4
400
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.7k
すこし踏み込む CancellationToken
htkym
2
1.5k
Java 27新機能 / Java 27 new features
kishida
2
190
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
740
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
290
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
1
110
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
Accessibility Awareness
sabderemane
1
230
How Software Deployment tools have changed in the past 20 years
geshan
2
34k
Building an army of robots
kneath
307
47k
We Have a Design System, Now What?
morganepeng
55
8.3k
We Are The Robots
honzajavorek
0
380
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
250
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
A Modern Web Designer's Workflow
chriscoyier
699
190k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
510
Un-Boring Meetings
codingconduct
0
440
The Curse of the Amulet
leimatthew05
3
15k
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