Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Overview of Google I/O 2019 for Android

Overview of Google I/O 2019 for Android

Google I/O Extended in Shinshu
https://gdg-shinshu.connpass.com/event/129173/

Avatar for Yuki Anzai

Yuki Anzai

June 01, 2019
Tweet

More Decks by Yuki Anzai

Other Decks in Technology

Transcript

  1. Yuki Anzai • Android App Developer (2009~) • CEO of

    uPhyca Inc. (2011~) • Google Developer Expert for Android • Organizer of GTUG Girls and droid girls • Twitter : @yanzm
  2. Google I/O • ೥1ճ։࠵͞ΕΔ Google ͷٕज़ऀ޲͚Πϕϯτ • ձ৔͸ΧϦϑΥϧχΞभͷ Mountain View

    ʹ͋Δ Shoreline Amphitheatre • Mountain View : ͍ΘΏΔγϦίϯόϨʔʹ͋Δ֗ͷҰͭ • Shoreline Amphitheatre : ԰֎ίϯαʔτձ৔ • ࠓ೥͸αϯάϥεΛ͘Εͳ͔ͬͨʂ
  3. Kotlin • AndroidͷެࣜαϙʔτݴޠͷҰͭʢଞ͸ Java, C++ʣ • Google I/O 2017Ͱൃද •

    Java ͱ૬ޓӡ༻ੑ͕͋Δ • ඪ४ϥΠϒϥϦͰ༻ҙ͞Ε͍ͯΔؔ਺܈͕Ϧον • Null ҆શੑʢNullable ܕͱ NonNull ܕ͕ผʣ
  4. Kotlin Sessions • What's New in Kotlin on Android, 2

    Years In (Google I/O'19) • https://www.youtube.com/watch?v=ldM6QZy9e0s • Kotlin Under the Hood: Understand the Internals (Google I/O'19) • https://www.youtube.com/watch?v=Ta5wBJsC39s • Understand Kotlin Coroutines on Android (Google I/O'19) • https://www.youtube.com/watch?v=BOHK_w09pVA
  5. Android Q • Share sheet • Bubbles • Noti fi

    cation Action • Dark Theme • Magni fi er • Privacy • ...
  6. Share sheet session • What's new in the Android OS

    User Interface (Google I/O'19) • https://www.youtube.com/watch?v=nWbW58RMteI
  7. Bubbles • ৽͍͠ multitasking way • ը໘ʹΞΠίϯ͕ fl oating Ͱදࣔ͞Εɺλοϓ͢Δͱ

    expand ͢Δ • ࢖͑Δͱ͖ • Messaging, Calling, User initiated • https://developer.android.com/preview/features/bubbles
  8. What's new in the Android OS User Interface (Google I/O'19)

    https://www.youtube.com/watch?v=nWbW58RMteI
  9. Bubbles session • What's new in the Android OS User

    Interface (Google I/O'19) • https://www.youtube.com/watch?v=nWbW58RMteI
  10. Dark Theme • Dark Theme & Gesture Navigation (Google I/O'19)

    • https://www.youtube.com/watch?v=OCHEjeLC_UY&t=22s
  11. Dark Theme • theme Λ Dark/Light ʹ੾Γସ͑Δ System theme setting

    ͕௥Ճ͞Εͨ • σόΠε͕όοςϦʔηʔόʔϞʔυʹೖͬͨΒɺγεςϜ UI ͸ࣗಈͰ Dark Theme ʹͳΔ • Dark Theme ͷαϙʔτ͸ڧ͘ਪ঑͞Ε͍ͯΔ • Material Design : https://material.io/design/color/dark-theme.html https://developer.android.com/preview/features/darktheme
  12. Force Dark • ࣗಈͰΞϓϦΛ dark theme ʹม׵͢Δ • opt-in ͢Δʹ͸

    • Force Dark ΑΓ΋ Custom ͷ Dark Theme Λ༻ҙͨ͠΄͏͕Α͍ • ͱΓ͋͑ͣ force dark ͷݟͨ໨Λ֬ೝ͍ͨ͠ → developer options ͷ force dark Λ༗ޮʹ͢Δ <style name="AppTheme" parent="..."> <item name="android:forceDarkAllowed">true</item> </style>
  13. AppCompat and MDC • DayNight <style name="AppTheme" parent="Theme.AppCompat.DayNight"> ... </style>

    <style name="AppTheme" parent="Theme.MaterialComponents.DayNight"> ... </style>
  14. class MyApplication : Application() { override fun onCreate() { super.onCreate()

    AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) // MODE_NIGHT_YES // MODE_NIGHT_NO // MODE_NIGHT_FOLLOW_SYSTEM // MODE_NIGHT_AUTO_BATTERY // MODE_NIGHT_UNSPECIFIED } } class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) delegate.localNightMode = AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM } }
  15. ΞϓϦ಺ઃఆ • Ϣʔβʔ͕ΞϓϦͷςʔϚΛબ΂ΔΑ͏ʹ͢΂͖ • Dark → MODE_NIGHT_YES • Light →

    MODE_NIGHT_NO • System default → MODE_NIGHT_FOLLOW_SYSTEM • Auto battery → MODE_NIGHT_AUTO_BATTERY
  16. Dark Theme ରԠ·ͱΊ • AppCompat or MDC ͷ DayNight Λར༻͠ɺϢʔβʔ͕ઃఆͰ͖ΔΑ͏

    ʹ͢Δ • AppCompat ͱ MDC Λ v1.1.0 ʹΞοϓσʔτ͢Δ • Force Dark ͰͱΓ͋͑ͣͷ dark theme ରԠ͕Ͱ͖Δ • ৭ͷ௚઀ࢦఆΛ΍ΊɺTheme attribute Λར༻͢Δ
  17. Privacy • ύʔϛογϣϯؔ܎ͷมߋ • Mac address ͷϥϯμϜԽ • foreground service

    ʹؔ͢Δมߋ • Shared Storage ΞΫηεʹؔ͢Δͷมߋ • ...
  18. Privacy • Overview of Privacy Changes in Android Q (Google

    I/O'19) • https://www.youtube.com/watch?v=bFp2n5OxYEE
  19. Overview of Privacy Changes in Android Q (Google I/O'19) https://www.youtube.com/watch?v=bFp2n5OxYEE

    Location ͷύʔϛογϣϯʹɺΞϓϦ͕ foreground ʹ͋Δ͚ؒͩڐՄɺͱ͍͏ͷ͕૿͑ͨ
  20. Overview of Privacy Changes in Android Q (Google I/O'19) https://www.youtube.com/watch?v=bFp2n5OxYEE

    ෆมͳσόΠεࣝผࢠʢIMEIͱ͔ʣ͕ READ_PHONE_STATE ύʔϛογϣϯͰऔಘͰ͖ ͳ͘ͳͬͨ
  21. Overview of Privacy Changes in Android Q (Google I/O'19) https://www.youtube.com/watch?v=bFp2n5OxYEE

    MAC ΞυϨεͷϥϯμϜԽ͕σϑΥϧτʹͳͬͨ ʢP Ͱ͸Φϓγϣϯʣ
  22. Overview of Privacy Changes in Android Q (Google I/O'19) https://www.youtube.com/watch?v=bFp2n5OxYEE

    MAC ΞυϨεͷϥϯμϜԽ͕σϑΥϧτʹͳͬͨ ʢP Ͱ͸Φϓγϣϯʣ
  23. Overview of Privacy Changes in Android Q (Google I/O'19) https://www.youtube.com/watch?v=bFp2n5OxYEE

    foreground service ʹͳΔͱ͖ʹλΠϓΛࢦఆ ͠ͳͯ͘͸͍͚ͳ͘ͳͬͨ
  24. Shared Storage • external storage ͱͯ͠஌ΒΕ͍ͯΔ΋ͷ • storage permission ʹΑͬͯ؅ཧ͞ΕΔ

    storage pool • What’s New in Shared Storage (Google I/O'19) • https://www.youtube.com/watch?v=3EtBw5s9iRY
  25. Shared Storage in Q • MediaStore ʹσʔλΛ௥Ճ͢Δͱ͖΍ɺҎલ௥Ճͨ͠σʔλʹΞΫηε ͢Δͱ͖͸ permission ͕ෆཁʹͳͬͨ

    • MediaStore ͷଞͷΞϓϦ͕௥Ճͨ͠σʔλʹΞΫηε͢Δͱ͖͸ permission ͕ඞཁ • MediaStore ֎ͷϑΝΠϧʹΞΫηε͢Δͱ͖͸ system picker ܦ༝Ͱͳ ͚Ε͹ͳΒͳ͍
  26. Android Studio sessions • What's New in Android Studio UI

    Design and Debugging Tools (Google I/O'19) • https://www.youtube.com/watch?v=oWTG5g5rT4s • What's New in the Android Studio Build System (Google I/O'19) • https://www.youtube.com/watch?v=LFRCzsD7UhY • Android Studio: Tips and Tricks (Google I/O'19) • https://www.youtube.com/watch?v=ihF-PwDfRZ4
  27. Android Studio sessions • What's New in Android Studio UI

    Design and Debugging Tools (Google I/O'19) • https://www.youtube.com/watch?v=oWTG5g5rT4s • What's New in the Android Studio Build System (Google I/O'19) • https://www.youtube.com/watch?v=LFRCzsD7UhY • Android Studio: Tips and Tricks (Google I/O'19) • https://www.youtube.com/watch?v=ihF-PwDfRZ4 ↓ ศརػೳͱ͔ɺγϣʔτΧοτΩʔͱ͔͕ͨ͘͞Μ঺հ͞Ε͍ͯΔ ɹ Φεεϝ
  28. Resource Manager • Android Studio 3.4 • Ϧιʔε؅ཧͷ৽͍͠ window •

    Batch import • Bulk import SVG and convert them to VectorDrawable • Preview all layouts • Integration with Layout Editor
  29. What's New in Android Studio UI Design and Debugging Tools

    (Google I/O'19) https://www.youtube.com/watch?v=oWTG5g5rT4s
  30. What's New in Android Studio UI Design and Debugging Tools

    (Google I/O'19) https://www.youtube.com/watch?v=oWTG5g5rT4s
  31. What's New in Android Studio UI Design and Debugging Tools

    (Google I/O'19) https://www.youtube.com/watch?v=oWTG5g5rT4s
  32. What's New in Android Studio UI Design and Debugging Tools

    (Google I/O'19) https://www.youtube.com/watch?v=oWTG5g5rT4s
  33. What's New in Android Studio UI Design and Debugging Tools

    (Google I/O'19) https://www.youtube.com/watch?v=oWTG5g5rT4s
  34. What's New in Android Studio UI Design and Debugging Tools

    (Google I/O'19) https://www.youtube.com/watch?v=oWTG5g5rT4s
  35. Emulator • Foldables • Headless emulator build • UIͳ͠ͰΤϛϡϨʔλΛىಈ •

    CIͰΤϛϡϨʔλΛར༻͢Δ৔߹ʹద͍ͯ͠Δ • https://androidstudio.googleblog.com/2019/02/emulator-2818- canary.html
  36. Emulator • Best Practices in Using the Android Emulator (Google

    I/O'19) • https://www.youtube.com/watch?v=Up3hyBSDAMA
  37. CameraX • alpha • Camera2 ϕʔε • Android 5.0 (API

    Level 21) Ҏ߱Λαϙʔτ • ML Kit ͳͲػցֶशͱͷ࿈ܞ͕؆୯ • Extension ͱ͍͏ optional add-on ػೳͰɺϙʔτϨΠτϞʔυ΍HDRͳ ͲσόΠεಠࣗͷػೳΛαϙʔτ
  38. CameraX • Android Jetpack: Understand the CameraX Camera-Support Library (Google

    I/O'19) • https://www.youtube.com/watch?v=kuv8uK-5CLY
  39. Jetpack Security Library • ϑΝΠϧɾSharePreferences ͷ҉߸Խ • Android 6.0 (API

    Level 23) Ҏ߱Λαϙʔτ • อ؅࣌ͷσʔλͷಡΈॻ͖ɺΩʔͷ࡞੒ͱݕূʹؔ࿈͢ΔηΩϡϦςΟͷ ϕετϓϥΫςΟεͷ࣮૷ • security best practices : https://developer.android.com/topic/ security/best-practices
  40. Jetpack Security Library • Security on Android: What's Next (Google

    I/O'19) • https://www.youtube.com/watch?v=0uG_RKiDmQY • https://developer.android.com/topic/security/data.md • https://developer.android.com/jetpack/androidx/releases/security
  41. Jetpack Benchmarking Library • Android Studio ͔Β Kotlin ϕʔε·ͨ͸ Java

    ϕʔεͷίʔυΛ͢͹΍ ͘ϕϯνϚʔΫ͢Δ͜ͱ͕Ͱ͖ΔϥΠϒϥϦ • https://developer.android.com/studio/pro fi le/benchmark.html androidTestImplementation "androidx.benchmark:benchmark:1.0.0-alpha01"
  42. Jetpack Benchmarking Library • Improving App Performance with Benchmarking (Google

    I/O'19) • https://www.youtube.com/watch?v=ZffMCJdA5Qc
  43. ConstraintLayout 2.x • Flexibility • Virtual Layouts • Helpers &

    Decorators • Programming APIs • Optimizer • MotionLayout • Design Tools: UI Builder, Motion Editor
  44. ConstraintLayout 2.x • What's New in ConstraintLayout (Google I/O'19) •

    https://www.youtube.com/watch?v=29gLA90m6Gk implementation "androidx.constraintlayout:constraintlayout:2.0.0-beta1"
  45. Programming APIs • ConstraintProperties val properties = ConstraintProperties(findViewById<View>(R.id.text)) properties.visibility(View.INVISIBLE) .apply()

    val set = ConstraintSet() set.clone(constraintLayout) set.setVisibility(R.id.textView, View.INVISIBLE) set.applyTo(constraintLayout)
  46. MotionLayout • ConstraintLayout ͷαϒΫϥε • constrains (੍໿) Λ xml fi

    le ʹ෼཭ • ࠷ॳͱ࠷ޙͷ ConstraintSet Λࢦఆ͢Δ͜ͱͰɺͦͷؒΛࣗಈͰΞχϝʔ γϣϯΛͤ͞Δ͜ͱ͕Ͱ͖Δ • KeyPosition, KeyAttribute, KeyTimeCycle
  47. Documentation • Reference : https://developer.android.com/reference/androidx/ constraintlayout/classes • Medium : Introduction

    to MotionLayout part I ~ IV • Sample : https://github.com/googlesamples/android- ConstraintLayoutExamples
  48. Kotlin First! • ktx • Kotlin ͚ͩͷػೳ • Kotlin ޲͚ͷ

    API σβΠϯ • coroutines αϙʔτ • ...
  49. Data Binding • ίϯύΠϧ͕ߴ଎Խ • Distributed build cache Λαϙʔτ •

    Incremental annotation processing • experimental ػೳ : android.databinding.incremental = true • Android Studio 3.5 ͰΑΓߴػೳͳ Refactoring support • Better error message
  50. by viewModels() class MainActivity : AppCompatActivity() { private lateinit var

    viewModel: MainViewModel override fun onCreate(savedInstanceState: Bundle?) { ... viewModel = ViewModelProviders.of(this) .get(MainViewModel::class.java) implementation "androidx.activity:activity-ktx:1.0.0-alpha08" implementation "androidx.fragment:fragment-ktx:1.1.0-alpha09" class MainActivity : AppCompatActivity() { private val viewModel: MainViewModel by viewModels()
  51. WorkManager • On-demand initialization • ඞཁʹͳͬͨͱ͖͚ͩ WorkManager ΛॳظԽ • WorkManage

    2.1.0 alpha • Google Play Services integration • totally optional, No API changes • Coming soon
  52. WorkManager • Robolectric support • stable • Worker unit testing

    • TestWorkerBuilder, TestListenableWorkerBuilder • 2.1.0 alpha
  53. ࣍ͷ version ͷ Paging Ͱ͸... • ΤϥʔॲཧؚΊͨ built in ͷωοτϫʔΫαϙʔτ

    • headers & footers • RxJava & Coroutines ରԠͷվળ • Soon in EAP, alpha this summer
  54. ࣍ͷ version ͷ Navigation Ͱ͸... • ViewModels scoped Navigation Graphs

    • Navigated by URI • Dialog destinations • Future: Better support for dynamic features
  55. • What's New in Google Play (Google I/O'19) • https://www.youtube.com/watch?v=o_oUeciBknU

    • Customizable Delivery with the App Bundle and Easy Sharing of Test Builds (Google I/O'19) • https://www.youtube.com/watch?v= fl hib2krW7U Google Play sessions
  56. App Bundle • apk ͱ͸ผͷ publishing format • ֦ுࢠ͸ .aab

    • σόΠε͕ඞཁͱ͢ΔϦιʔε͚ͩΛΞϓϦʹμ΢ϯϩʔυ&Πϯετʔ ϧ • Google ͷΞϓϦ΋ଟ͕͘ App Bundle ʹҠߦͨ͠
  57. Customizable Delivery with the App Bundle and Easy Sharing of

    Test Builds (Google I/O'19) https://www.youtube.com/watch?v= fl hib2krW7U
  58. Customizable Delivery with the App Bundle and Easy Sharing of

    Test Builds (Google I/O'19) https://www.youtube.com/watch?v= fl hib2krW7U
  59. Conditional delivery • dynamic feature modules Λࢦఆͨ͠৚݅Λຬͨ͢σόΠεʹͷΈ഑৴͢ Δػೳ • Countryʢࠃʣ,

    minSDK version, Device ͷػೳʢΧϝϥ͕͋Δ͔ͳͲʣ ͰࢦఆͰ͖Δ • https://developer.android.com/studio/projects/dynamic-delivery/ conditional-delivery
  60. On-demand delivery • ಛఆͷ dynamic feature module Λ on-demand ʹΠϯετʔϧɾ࡟আ͢

    Δػೳ • https://developer.android.com/studio/projects/dynamic-delivery/on- demand-delivery • ྫʣContact support ػೳΛඞཁʹͳ͔ͬͯΒΠϯετʔϧ͢Δ • ྫʣΦϯϘʔσΟϯάॲཧ͕ऴΘͬͨΒɺΦϯϘʔσΟϯάػೳΛ࡟আ͢ Δ
  61. Customizable Delivery with the App Bundle and Easy Sharing of

    Test Builds (Google I/O'19) https://www.youtube.com/watch?v= fl hib2krW7U
  62. Internal app sharing • apk ΍ App Bundle Λ Google

    Play ʹΞοϓϩʔυ͢Δ͜ͱͰɺϦϯΫ ܦ༝Ͱࣾ಺νʔϜ΍ςελʔ͕μ΢ϯϩʔυˍΠϯετʔϧͰ͖Δػೳ • https://support.google.com/googleplay/android-developer/answer/ 9303479 New Tools to Optimize Your App's Size and Boost Installs on Google Play (Google I/O'19) https://www.youtube.com/watch?v=rEuwVWpYBOY
  63. Internal app sharing • Ξοϓϩʔυ͢Δਓ͸ Play Console ͷϝϯόʔͰͳͯ͘΋Α͍ • production

    key Ͱॺ໊͠ͳͯ͘΋Α͍ = σόοάϏϧυͰ΋Α͍ • version code ੍ݶ͕ͳ͍ • ϝʔϦϯάϦετͰ഑৴ઌΛ੍ݶ or ϦϯΫΛ஌͍ͬͯΔਓ͸୭Ͱ΋μ΢ ϯϩʔυՄೳ
  64. Internal app sharing • https://play.google.com/apps/publish/internalappsharing/ ʹϏϧυ͠ ͨ apk/aab ΛΞοϓϩʔυ •

    ੜ੒͞ΕͨϦϯΫ͔ΒΞϓϦΛΠϯετʔϧͰ͖Δ • Πϯετʔϧ͢Δଆ͸ PlayStore ΞϓϦͰ։ൃऀϞʔυʹͳΓɺInternal app sharing Λ༗ޮʹ͢Δඞཁ͕͋Δ
  65. Customizable Delivery with the App Bundle and Easy Sharing of

    Test Builds (Google I/O'19) https://www.youtube.com/watch?v= fl hib2krW7U
  66. Installs on Google Play • Google Play ͰͷΠϯετʔϧʹؔ͢Δվળ • Uninstall

    Wizard • Optimized downloads • Optimized native libraries • Peer-to-peer • Data at no cost
  67. Installs on Google Play • New Tools to Optimize Your

    App's Size and Boost Installs on Google Play (Google I/O'19) • https://www.youtube.com/watch?v=rEuwVWpYBOY
  68. App size • App upload size • App download size

    → Πϯετʔϧ཰ʹӨڹ͢Δ • App size on device [new] → ΞϯΠϯετʔϧ཰ʹӨڹ͢Δ
  69. Google Play console ʹ app download size ͱ app size

    on device ʹؔ͢Δ ৘ใؚ͕·ΕΔΑ͏ʹͳͬͨ
  70. Google Play console ͰΞϓϦͷαΠζ (app download size ͱ app size

    on device) ͷ࣌ؒมԽ͕ݟΕΔΑ͏ʹͳͬͨ
  71. Play Billing • What's New with Google Play Billing (Google

    I/O'19) • https://www.youtube.com/watch?v=N4004Set4F8
  72. Play Billing Library 2.0 • Kotlin ͱ C++ ൛͸ coming

    soon • Billing Library ͕ of fi cial way ʹ • AIDL/Billing Library 1.x ͸ deprecated • https://developer.android.com/google/play/billing/ billing_library_releases_notes
  73. What's New with Google Play Billing (Google I/O'19) https://www.youtube.com/watch?v=N4004Set4F8 Install

    ࣌ʹ SubscribeʢϑϦʔτϥΠΞϧ ˠ Subscribeʣ ͢Δϓϥϯ͕௥Ճ͞Εͨ
  74. What's New with Google Play Billing (Google I/O'19) https://www.youtube.com/watch?v=N4004Set4F8 in-app

    Ͱͷߪೖʹ೚ҙͷ data Λఴ෇Ͱ͖ΔΑ͏ʹͳͬͨ A/B ςετ΍ɺϢʔβʔͷ identify ʹศར
  75. Subscription • Subscribe & Install • one time promotion codes

    • Pause subscription • Subscription Λ Pause Ͱ͖ΔΑ͏ʹͳͬ ͨʢࠓ·Ͱ͸ΩϟϯηϧͷΈʣ
  76. Subscription • Subscribe & Install • one time promotion codes

    • Pause subscription • Cancel Survey report on console •
  77. Subscription • Subscribe & Install • one time promotion codes

    • Pause subscription • Cancel Survey report on console • Longer Grace Period ՝ۚॲཧͷࣦഊͰ Subscription ͕ࢭ·ͬͨ ͱ͖ͷ༛༧ظؒΛ௕͘Ͱ͖ΔΑ͏ʹͳͬͨ ʢࠓ·Ͱ͸ 3 - 7೔ʣ
  78. Modularize sessions • Build a Modular Android App Architecture (Google

    I/O'19) • https://www.youtube.com/watch?v=PZBg5DIzNww • Build Testable Apps for Android (Google I/O'19) • https://www.youtube.com/watch?v=VJi2vmaQe6w