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
AndroidXに潜む便利なヤツら
Search
Takuji Nishibayashi
April 19, 2019
Technology
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AndroidXに潜む便利なヤツら
Takuji Nishibayashi
April 19, 2019
More Decks by Takuji Nishibayashi
See All by Takuji Nishibayashi
compose-hot-reload を試そうとした話
takuji31
0
170
CameraX使ってみた
takuji31
0
320
kotlinx.datetime 使ってみた
takuji31
0
1.1k
HiltのCustom Componentについて
takuji31
0
450
java.timeをAndroidで使う
takuji31
0
220
KSPを使ってコード生成
takuji31
0
500
Kotlin Symbol Processing API (KSP) を使って Kotlin ア プリケーションの開発を効率化する
takuji31
1
3.3k
kotlinx.serialization
takuji31
0
710
kanmoba-returns-02.pdf
takuji31
0
300
Other Decks in Technology
See All in Technology
Harness Engineering on Rails
joelq
0
680
あけおめLINE 傾向とその対策
nasa9084
0
340
なぜAI任せのゲームは面白くならないのか?
hirohasuyoutube
0
210
なぜ「決定性」が 決定的に重要なのか? Durable Execution 基盤の数理的理解 #serverlessjp / ServerlessDays Tokyo 2026
ytaka23
4
1.3k
AWS FinOps Agent 結局何が得意なの?
siromi
0
210
高負荷プロダクション環境におけるAWS Lambdaのリアル 〜スケールとコストを左右する実行ライフサイクルの技術仕様〜
maimyyym
2
740
GoのInterface内部構造から学ぶ!最高パフォーマンスを出すコード設計
yappli_developers
1
300
AIエージェントを安全で速い現場監督にする:Jev・Obsidian・メタハーネス
x5gtrn
PRO
0
140
AIに書かせて、プラットフォームで縛る ― EKSプラットフォームで実践した責任境界と権限設計
elmodev09
1
900
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
3
21k
サーバーレスをどこまで使う? WebRTC対戦ゲームで選んだVPSとの共存設計
kaidouji85
0
480
AI Agent入門〜今更聞けないAgentの話〜
hiromimaganuma
0
120
Featured
See All Featured
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
530
The World Runs on Bad Software
bkeepers
PRO
72
12k
Paper Plane
katiecoart
PRO
4
53k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Rails Girls Zürich Keynote
gr2m
96
14k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
290
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Transcript
AndroidXʹજΉศརͦ͏ͳϠπΒ @takuji31 Mobile Act KYOTO #1
ࣗݾհ
ࣗݾհ • @takuji31 id:takuji31 • Takuji Nishibayashi • Hatena Co.,
Ltd. • App Team • ίϛοΫDAYS • δϟϯϓϧʔΩʔʂ • ΧΫϤϜ
ࣗݾհ • Android • Kotlin • Flu-er • ! h-ps:/
/blog.takuji31.jp • " h-ps:/ /nazuna.takuji31.jp • # $ h-ps:/ /photo.takuji31.jp
AndroidX
LiveData? ViewModel? AppCompat? Naviga5on
ͬͯ·͢ΑͶ
ศརͳͭ৭ʑհ͠·͢
α൛ͷͷؚ·ΕΔͷͰ ͝ར༻ܭըతʹ
ଞʹ͍͍ͷ͋ͬͨΒ ڭ͍͑ͯͩ͘͞ʂ
androidx.ac*vity androidx.fragment
ComponentActivity.viewModels{} Fragment.viewModels{} Fragment.activityViewModels{}
ViewModelΛऔಘͰ͖Δ Delegated property
viewModels ҾͰ ViewModelStoreOwnerΛ୳͢ blockΛͤΔ
valʹͰ͖Δ
Goodbye! private lateinit var
@ContentView
ComponentAc*vity ͱ Fragmentʹ secondory constructor͕Ճ
constructorͷҾʹLayoutͷIDΛ ͤΔ
Goodbye setContentView()
DataBindingbind͢ΕΑͦ͞͏
androidx.lifecycle
ViewModelͱ͔LiveDataͱ͔ೖͬͯ ΔΞϨ
ViewModel.viewModelScope
ViewModelͷCorou,neScope
Context Dispatchers.Main + Job
onCleared() ͰΩϟϯηϧ
Saved State
ViewModelը໘ճసΛੜ͖Δ
Ac#vity͕ϝϞϦʔ͔Β ഁغ͞ΕΔ࣌ࢮ͵
SavedStateHandler Ͱঢ়ଶΛ෮ݩͰ͖Δ
γϯϓϧͳ set/get/remove/contains
getLiveData()
see. h&ps:/ /developer.android.com/ topic/libraries/architecture/ viewmodel-savedstate
androidx.navigation
Naviga&onͷΞϨ
androidx.navigation.safeargs androidx.navigation.safeargs.kotlin
Naviga&onͷxmlʹఆٛͨ͠ભҠઌ ͷargsΛࣗಈੜ
KotlinίʔυੜՄೳ
Goodbye createIntent() methods!
Naviga&onͰը໘ભҠ͠ͳͯ͘ ͑Δ
·ͣͬͯΈͯʂ
Fragment.navGraphViewModels()
ࢦఆͨ͠Naviga&onͷgraphͰੜ͖ ΔFragment
NavHostFragmentͷFragment Ͱ͏ɺΈ͍ͨͳײ͡ͷ࣌ʹ͑ͦ ͏
͜Εॻ͍ͯͯࠓ࣮ͯ͠Δը໘Ͱ ͑ͦ͏ͱࢥͬͨͷͰ͏༧ఆ
h"ps:/ /developer.android.com/ jetpack/androidx