ࢹௌͨ͠ηογϣϯ
• Keynote
• What’s New in Android Studio
• LiveData with Coroutine Flow
• Fragments Past / Future
• Androidx Webkit
• Going Edge to Edge with Gesture Navigation
• Supercharge Sharing to your App
• Migrate to Androidx: The time is right
• Debugging Tips and n’Tricks
• Performance Myth Busters
• Demystify the Data
in Android Studio Profilers
• Monitoring and Improving
Real-World Stability and Performance
• Fragments Past / Future
• Performance Analysis Using Systrace
Slide 6
Slide 6 text
Some Topics
Slide 7
Slide 7 text
ࠓ͙͢ϓϩμΫτʹ͍Ε͍ͨػೳͨͪ
• Edge to Edge navigationͷNavigation Conflict
Slide 8
Slide 8 text
ࠓ͙͢ϓϩμΫτʹ͍Ε͍ͨػೳͨͪ
• Share SheetΛ֦ு͢Δʂ
Slide 9
Slide 9 text
ࠓ͙͢ϓϩμΫτʹ͍Ε͍ͨػೳͨͪ
• Fragment Factory
Slide 10
Slide 10 text
Monitoring and Improving
Real-World Stability and Performance
Android Vitals׆༻ͯ͠·͔͢ʁ
https://youtu.be/mXzy0NX9bSM
ηογϣϯͰऔΓ্͛ΒΕ͍֤ͯͨࣾͷରԠࣄྫ
• Migrated from background services to MediaBrows
erService(API26)
• Moved to WorkManager
• Reduced use of Shared Preferences
• Reorganized the app graph to perform less object i
nstantiation in application's onCreate()
Slide 29
Slide 29 text
Demystify the Data
in Android Studio Profilers
ߴػೳͳ1SPGJMFS͕͍ͭͯ·͕͢ɺ
׆༻ͯ͠·͔͢ʁ
https://youtu.be/v4kCRZ_O4Lc
Slide 30
Slide 30 text
ProfilerΛͬͯϝϞϦϦʔΫͱରቂ͢Δ
• CPU / Memory / Network / EnergyͷࢦඪͰݟΕΔ
• Memoryʹ Leaked Activities and Fragments ͕૿͑
ͯΔʢAS3.6ʣ
Slide 31
Slide 31 text
Leaked Activities and Fragments
·ͣHeap DumpΛͱΔ
͜͜ʹग़ͯ͘Δ
ϦʔΫͯ͠ΔActivity / Fragment
Slide 32
Slide 32 text
ActivityͱFragmentͷϦʔΫͱʁ
• Activity
• Has been destroyed but is still referenced
• Fragment
• Does not have a valid FragmentManager
but is still referenced
• Possible false positives
• Created but has not yet been used
• Being cached but not as part of a Fragmenttransaction
Migrating to AndroidX
• ΄΅ͯ͢ͷϑΝΠϧʹมߋ͕ೖΔͷͰɺ
ଞ࡞ۀͱฏߦͯ͢͢͠ΊΔͷ͓͢͢ΊͰ͖ͳ͍
⇢࡞ۀλΠϛϯάΛௐ͢Δ
• Ұ൪࢝ΊʹɺϓϩδΣΫτΛόοΫΞοϓ͢Δ͜ͱ
Slide 42
Slide 42 text
Migrating to AndroidX
1. Update to SL 28
AndroidXͷҠߦ =ʮAPI ChangeʯʮPackage Changeʯ
Support Library 28 <=> AndroidX 1.0ͷࠩPackageͷΈ
·ͣSL28ͷΞοϓσʔτΛߦ͍ɺ
API changesʹΑͬͯյΕͳ͍͜ͱΛ֬ೝ͢Δ
Slide 43
Slide 43 text
Migrating to AndroidX
2. Enable Jetifier
Jetifier will:
- Migrate your third-party dependencies to use AndroidX
Jetifier will not:
- Migrate your source code
- Migrate generated code
Slide 44
Slide 44 text
Migrating to AndroidX
3. Update Dependencies
Ұ෦ͷ3rdPartyϥΠϒϥϦΞοϓσʔτ͕ඞཁ
Annotation ProcessorͳͲͷίʔυੜܥͷͷ
ผ్ରԠ͕ͻͭΑ͏ʹͳΔ
Slide 45
Slide 45 text
Migrating to AndroidX
4. Use Studio
Refactor > Migrate to AndroidX
Slide 46
Slide 46 text
Migrating to AndroidX
5. Bash Script or Edit yourself
Replace all source code instance of support library packages
with their AndroidX version
https://goo.gle/androidx-migration-script