Overview of Google I/O 2019
for Android
あんざいゆき (@yanzm)
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
Share sheet session
• What's new in the Android OS User Interface (Google I/O'19)
• https://www.youtube.com/watch?v=nWbW58RMteI
Slide 18
Slide 18 text
Bubbles
• 新しい multitasking way
• 画⾯にアイコンが floating で表⽰され、タップすると expand する
• 使えるとき
• Messaging, Calling, User initiated
• https://developer.android.com/preview/features/bubbles
Slide 19
Slide 19 text
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 を利⽤する
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
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=flhib2krW7U
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=flhib2krW7U
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=flhib2krW7U
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 が official 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