Overview of Google I/O 2019
for Android
͋Μ͍͟Ώ͖ (@yanzm)
Google I/O Extended in Shinshu
Slide 2
Slide 2 text
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
What's new in Android (Google I/O'19)
https://www.youtube.com/watch?v=td3Kd7fOROw
Slide 11
Slide 11 text
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
Slide 12
Slide 12 text
Android Q
• ࣍ͷ OS version
͍·͜͜
Slide 13
Slide 13 text
Android Q
• Share sheet
• Bubbles
• Noti
fi
cation Action
• Dark Theme
• Magni
fi
er
• Privacy
• ...
What's new in Android (Google I/O'19)
https://www.youtube.com/watch?v=td3Kd7fOROw
Slide 20
Slide 20 text
What's new in the Android OS User Interface (Google I/O'19)
https://www.youtube.com/watch?v=nWbW58RMteI
Slide 21
Slide 21 text
Bubbles session
• What's new in the Android OS User Interface (Google I/O'19)
• https://www.youtube.com/watch?v=nWbW58RMteI
Slide 22
Slide 22 text
No content
Slide 23
Slide 23 text
Dark Theme
Slide 24
Slide 24 text
Dark Theme
• Dark Theme & Gesture Navigation (Google I/O'19)
• https://www.youtube.com/watch?v=OCHEjeLC_UY&t=22s
Slide 25
Slide 25 text
Dark Theme
Slide 26
Slide 26 text
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
Slide 27
Slide 27 text
Force Dark
• ࣗಈͰΞϓϦΛ dark theme ʹม͢Δ
• opt-in ͢Δʹ
• Force Dark ΑΓ Custom ͷ Dark Theme Λ༻ҙͨ͠΄͏͕Α͍
• ͱΓ͋͑ͣ force dark ͷݟͨΛ֬ೝ͍ͨ͠ → developer options ͷ force
dark Λ༗ޮʹ͢Δ
<item name="android:forceDarkAllowed">true</item>
Slide 28
Slide 28 text
AppCompat and MDC
• DayNight
...
...
Slide 29
Slide 29 text
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
}
}
Slide 30
Slide 30 text
ΞϓϦઃఆ
• Ϣʔβʔ͕ΞϓϦͷςʔϚΛબΔΑ͏ʹ͖͢
• Dark → MODE_NIGHT_YES
• Light → MODE_NIGHT_NO
• System default → MODE_NIGHT_FOLLOW_SYSTEM
• Auto battery → MODE_NIGHT_AUTO_BATTERY
Slide 31
Slide 31 text
Dark Theme ରԠ·ͱΊ
• AppCompat or MDC ͷ DayNight Λར༻͠ɺϢʔβʔ͕ઃఆͰ͖ΔΑ͏
ʹ͢Δ
• AppCompat ͱ MDC Λ v1.1.0 ʹΞοϓσʔτ͢Δ
• Force Dark ͰͱΓ͋͑ͣͷ dark theme ରԠ͕Ͱ͖Δ
• ৭ͷࢦఆΛΊɺTheme attribute Λར༻͢Δ
Slide 32
Slide 32 text
https://developer.android.com/guide/topics/text/magni
fi
er
ͷ༰ݱ࣌ʢ2019/6/1ʣͰݹ͍ͷͰҙ
Slide 33
Slide 33 text
Privacy
• ύʔϛογϣϯؔͷมߋ
• Mac address ͷϥϯμϜԽ
• foreground service ʹؔ͢Δมߋ
• Shared Storage ΞΫηεʹؔ͢Δͷมߋ
• ...
Slide 34
Slide 34 text
Privacy
• Overview of Privacy Changes in Android Q (Google I/O'19)
• https://www.youtube.com/watch?v=bFp2n5OxYEE
Slide 35
Slide 35 text
Overview of Privacy Changes in Android Q (Google I/O'19)
https://www.youtube.com/watch?v=bFp2n5OxYEE
Location ͷύʔϛογϣϯʹɺΞϓϦ͕
foreground ʹ͋Δ͚ؒͩڐՄɺͱ͍͏ͷ͕૿͑ͨ
Slide 36
Slide 36 text
Overview of Privacy Changes in Android Q (Google I/O'19)
https://www.youtube.com/watch?v=bFp2n5OxYEE
ෆมͳσόΠεࣝผࢠʢIMEIͱ͔ʣ͕
READ_PHONE_STATE ύʔϛογϣϯͰऔಘͰ͖
ͳ͘ͳͬͨ
Slide 37
Slide 37 text
Overview of Privacy Changes in Android Q (Google I/O'19)
https://www.youtube.com/watch?v=bFp2n5OxYEE
MAC ΞυϨεͷϥϯμϜԽ͕σϑΥϧτʹͳͬͨ
ʢP ͰΦϓγϣϯʣ
Slide 38
Slide 38 text
Overview of Privacy Changes in Android Q (Google I/O'19)
https://www.youtube.com/watch?v=bFp2n5OxYEE
MAC ΞυϨεͷϥϯμϜԽ͕σϑΥϧτʹͳͬͨ
ʢP ͰΦϓγϣϯʣ
Slide 39
Slide 39 text
Overview of Privacy Changes in Android Q (Google I/O'19)
https://www.youtube.com/watch?v=bFp2n5OxYEE
foreground service ʹͳΔͱ͖ʹλΠϓΛࢦఆ
͠ͳ͍͚ͯ͘ͳ͘ͳͬͨ
Slide 40
Slide 40 text
Overview of Privacy Changes in Android Q (Google I/O'19)
https://www.youtube.com/watch?v=bFp2n5OxYEE
Shared Storage ͷΞΫηεʹมߋ͕ೖͬͨ
Slide 41
Slide 41 text
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
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
Slide 45
Slide 45 text
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
↓ ศརػೳͱ͔ɺγϣʔτΧοτΩʔͱ͔͕ͨ͘͞Μհ͞Ε͍ͯΔ
ɹ Φεεϝ
Slide 46
Slide 46 text
Resource Manager
• Android Studio 3.4
• Ϧιʔεཧͷ৽͍͠ window
• Batch import
• Bulk import SVG and convert them to VectorDrawable
• Preview all layouts
• Integration with Layout Editor
Slide 47
Slide 47 text
What's New in Android Studio UI Design and Debugging Tools (Google I/O'19)
https://www.youtube.com/watch?v=oWTG5g5rT4s
Slide 48
Slide 48 text
What's New in Android Studio UI Design and Debugging Tools (Google I/O'19)
https://www.youtube.com/watch?v=oWTG5g5rT4s
Slide 49
Slide 49 text
What's New in Android Studio UI Design and Debugging Tools (Google I/O'19)
https://www.youtube.com/watch?v=oWTG5g5rT4s
Slide 50
Slide 50 text
What's New in Android Studio UI Design and Debugging Tools (Google I/O'19)
https://www.youtube.com/watch?v=oWTG5g5rT4s
Slide 51
Slide 51 text
What's New in Android Studio UI Design and Debugging Tools (Google I/O'19)
https://www.youtube.com/watch?v=oWTG5g5rT4s
Slide 52
Slide 52 text
What's New in Android Studio UI Design and Debugging Tools (Google I/O'19)
https://www.youtube.com/watch?v=oWTG5g5rT4s
Programming APIs
• ConstraintProperties
val properties = ConstraintProperties(findViewById(R.id.text))
properties.visibility(View.INVISIBLE)
.apply()
val set = ConstraintSet()
set.clone(constraintLayout)
set.setVisibility(R.id.textView, View.INVISIBLE)
set.applyTo(constraintLayout)
Slide 71
Slide 71 text
MotionLayout
• ConstraintLayout ͷαϒΫϥε
• constrains (੍) Λ xml
fi
le ʹ
• ࠷ॳͱ࠷ޙͷ ConstraintSet Λࢦఆ͢Δ͜ͱͰɺͦͷؒΛࣗಈͰΞχϝʔ
γϣϯΛͤ͞Δ͜ͱ͕Ͱ͖Δ
• KeyPosition, KeyAttribute, KeyTimeCycle
Slide 72
Slide 72 text
Documentation
• Reference : https://developer.android.com/reference/androidx/
constraintlayout/classes
• Medium : Introduction to MotionLayout part I ~ IV
• Sample : https://github.com/googlesamples/android-
ConstraintLayoutExamples
lifecycle-livedata-ktx
Transformations.map(liveData) { user ->
user.name
}
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.2.0-alpha01"
liveData.map { user -> user.name }
Slide 90
Slide 90 text
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()
Slide 91
Slide 91 text
WorkManager
• On-demand initialization
• ඞཁʹͳͬͨͱ͖͚ͩ WorkManager ΛॳظԽ
• WorkManage 2.1.0 alpha
• Google Play Services integration
• totally optional, No API changes
• Coming soon
Slide 92
Slide 92 text
WorkManager
• Robolectric support
• stable
• Worker unit testing
• TestWorkerBuilder, TestListenableWorkerBuilder
• 2.1.0 alpha
Slide 93
Slide 93 text
Room
• Coroutines support
Slide 94
Slide 94 text
No content
Slide 95
Slide 95 text
Room
• Coroutines support
• Full Text Search
Slide 96
Slide 96 text
No content
Slide 97
Slide 97 text
No content
Slide 98
Slide 98 text
Room
• Coroutines support
• Full Text Search
• DatabaseView
Slide 99
Slide 99 text
No content
Slide 100
Slide 100 text
No content
Slide 101
Slide 101 text
࣍ͷ version ͷ Paging Ͱ...
• ΤϥʔॲཧؚΊͨ built in ͷωοτϫʔΫαϙʔτ
• headers & footers
• RxJava & Coroutines ରԠͷվળ
• Soon in EAP, alpha this summer
Slide 102
Slide 102 text
࣍ͷ version ͷ Navigation Ͱ...
• ViewModels scoped Navigation Graphs
• Navigated by URI
• Dialog destinations
• Future: Better support for dynamic features
Slide 103
Slide 103 text
Google Play
Slide 104
Slide 104 text
• 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
Slide 105
Slide 105 text
App Bundle
• apk ͱผͷ publishing format
• ֦ுࢠ .aab
• σόΠε͕ඞཁͱ͢ΔϦιʔε͚ͩΛΞϓϦʹμϯϩʔυ&Πϯετʔ
ϧ
• Google ͷΞϓϦଟ͕͘ App Bundle ʹҠߦͨ͠
Slide 106
Slide 106 text
What's New in Google Play (Google I/O'19)
https://www.youtube.com/watch?v=o_oUeciBknU
Slide 107
Slide 107 text
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
Slide 115
Slide 115 text
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
Slide 116
Slide 116 text
Internal app sharing
• Ξοϓϩʔυ͢Δਓ Play Console ͷϝϯόʔͰͳͯ͘Α͍
• production key Ͱॺ໊͠ͳͯ͘Α͍ = σόοάϏϧυͰΑ͍
• version code ੍ݶ͕ͳ͍
• ϝʔϦϯάϦετͰ৴ઌΛ੍ݶ or ϦϯΫΛ͍ͬͯΔਓ୭Ͱμ
ϯϩʔυՄೳ
Customizable Delivery with the App Bundle and Easy Sharing of Test Builds (Google I/O'19)
https://www.youtube.com/watch?v=
fl
hib2krW7U
Slide 119
Slide 119 text
What's New in Google Play (Google I/O'19)
https://www.youtube.com/watch?v=o_oUeciBknU
ࣅͨΞϓϦΛબͯ͠ɺGoogle Play Console
ͰϕϯνϚʔΫΛൺֱͰ͖ΔΑ͏ʹͳͬͨ
Slide 120
Slide 120 text
What's New in Google Play (Google I/O'19)
https://www.youtube.com/watch?v=o_oUeciBknU
metrics ͕৽͘͠ͳͬͨ
Slide 121
Slide 121 text
What's New in Google Play (Google I/O'19)
https://www.youtube.com/watch?v=o_oUeciBknU
৽͍͠ฏۉ rating ɺΑΓ࠷ۙͷ
rating ʹॏΈΛ࣋ͨͤΔΑ͏ʹͳΔ
Slide 122
Slide 122 text
What's New in Google Play (Google I/O'19)
https://www.youtube.com/watch?v=o_oUeciBknU
ϨϏϡʔͷฦ৴จΛαδΣετͯ͘͠ΕΔ
Slide 123
Slide 123 text
Installs on Google Play
• Google Play ͰͷΠϯετʔϧʹؔ͢Δվળ
• Uninstall Wizard
• Optimized downloads
• Optimized native libraries
• Peer-to-peer
• Data at no cost
Slide 124
Slide 124 text
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
Google Play ͷ౷ܭʹ app download size ͱ app size on device ؚ͕·ΕΔ
Α͏ʹͳͬͨ
Slide 132
Slide 132 text
Google Play console ʹ app download size ͱ app size on device ʹؔ͢Δ
ใؚ͕·ΕΔΑ͏ʹͳͬͨ
Slide 133
Slide 133 text
Google Play console ͰΞϓϦͷαΠζ (app download size ͱ app size on
device) ͷ࣌ؒมԽ͕ݟΕΔΑ͏ʹͳͬͨ
Slide 134
Slide 134 text
Google Play console ͰΞϓϦͷαΠζͷߏ͕ݟΕΔΑ͏ʹͳͬͨ
Slide 135
Slide 135 text
Google Play Billing
Slide 136
Slide 136 text
Play Billing
• What's New with Google Play Billing (Google I/O'19)
• https://www.youtube.com/watch?v=N4004Set4F8
Slide 137
Slide 137 text
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
Slide 138
Slide 138 text
What's New with Google Play Billing (Google I/O'19)
https://www.youtube.com/watch?v=N4004Set4F8
ίϯϏχ͍ۜߦৼࠐͳͲ
Slide 139
Slide 139 text
What's New with Google Play Billing (Google I/O'19)
https://www.youtube.com/watch?v=N4004Set4F8
Install ࣌ʹ SubscribeʢϑϦʔτϥΠΞϧ
ˠ Subscribeʣ ͢Δϓϥϯ͕Ճ͞Εͨ
Slide 140
Slide 140 text
Acknowledge all purchases
• ඇফඅܕΞΠςϜͷߪೖ֬ೝ͕ͱΕͨΒɺGoogle Play ଆʹ
acknowledge ΛૹΒͳ͍ͱ͍͚ͳ͘ͳͬͨ
• 3Ҏʹ acknowledge ΛૹΒͳ͍ͱฦۚ͞ΕΔ
Slide 141
Slide 141 text
Consistent Offers
• Play ͷߪೖϑϩʔͰ promotion Ձ֨Λදࣔ͠ɺͦΕͰߪೖͰ͖ΔΑ͏ʹ
ͳΔ
Slide 142
Slide 142 text
What's New with Google Play Billing (Google I/O'19)
https://www.youtube.com/watch?v=N4004Set4F8
ߪೖΧʔτ͕ग़ͯ͘Δ·Ͱͷ
͕࣌ؒ͘ͳͬͨ
Slide 143
Slide 143 text
What's New with Google Play Billing (Google I/O'19)
https://www.youtube.com/watch?v=N4004Set4F8
in-app Ͱͷߪೖʹҙͷ data ΛఴͰ͖ΔΑ͏ʹͳͬͨ
A/B ςετɺϢʔβʔͷ identify ʹศར
Slide 144
Slide 144 text
What's New with Google Play Billing (Google I/O'19)
https://www.youtube.com/watch?v=N4004Set4F8