Slide 1

Slide 1 text

Android App Bundle @_a_akira CA.aab (apk) Google I/O 2018報告会

Slide 2

Slide 2 text

About me @_a_akira AAkira CyberAgent, Inc. FRESH! Akira Aratani

Slide 3

Slide 3 text

Agenda • About Android App Bundle • App Bundle • Dynamic Delivery • Develop Android App Bundle • Upload .aab file to PlayStore • bundle tool • Summary

Slide 4

Slide 4 text

About Android App Bundle

Slide 5

Slide 5 text

https://www.youtube.com/watch?v=flU42CTF3MQ Google I/O 2018 Developer keynote (0:09:00頃)

Slide 6

Slide 6 text

Innovative distribution

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

1% down per 6MB

Slide 9

Slide 9 text

Android App Bundle 10PB saved per day

Slide 10

Slide 10 text

Android App Bundle .aab ≠ .apk

Slide 11

Slide 11 text

Android App Bundle

Slide 12

Slide 12 text

Android App Bundle arm 64 bit Lang : US hdpi x86 arm xxhdpi xhdpi dpi Lang : JA Lang : PL Lang : IT Lang : IS Lang : FR Lang : DE Lang : ES Lang : NL Lang : TR

Slide 13

Slide 13 text

Android App Bundle arm 64 bit Lang : US hdpi x86 arm xxhdpi xhdpi dpi Lang : JA Lang : PL Lang : IT Lang : IS Lang : FR Lang : DE Lang : ES Lang : NL Lang : TR

Slide 14

Slide 14 text

Android App Bundle arm 64 bit Lang : US hdpi x86 arm xxhdpi xhdpi dpi Lang : JA Lang : PL Lang : IT Lang : IS Lang : FR Lang : DE Lang : ES Lang : NL Lang : TR arm 64 bit Lang : US hdpi x86 arm xxhdpi xhdpi dpi Lang : JA Lang : PL Lang : IT Lang : IS Lang : FR Lang : DE Lang : ES Lang : NL Lang : TR 全てのリソースを 端末にインストール

Slide 15

Slide 15 text

Android App Bundle arm 64 bit Lang : US hdpi x86 arm xxhdpi xhdpi dpi Lang : JA Lang : PL Lang : IT Lang : IS Lang : FR Lang : DE Lang : ES Lang : NL Lang : TR

Slide 16

Slide 16 text

Android App Bundle hdpi x86 arm arm 64 bit Lang : US xxhdpi xhdpi dpi Lang : JA Lang : PL Lang : IT Lang : IS Lang : FR Lang : DE Lang : ES Lang : NL Lang : TR arm 64 bit Lang : US xxhdpi 必要なリソースのみを 端末にインストール

Slide 17

Slide 17 text

Android App Bundle

Slide 18

Slide 18 text

Android App Bundle FRESH! 35.8% saving

Slide 19

Slide 19 text

Dynamic Delivery

Slide 20

Slide 20 text

Dynamic Delivery Sell Browse Buy e-commerce app

Slide 21

Slide 21 text

Dynamic Delivery Sell Browse Buy e-commerce app Browse Buy 初回DLでは必要な部分だけ

Slide 22

Slide 22 text

Dynamic Delivery Browse Buy Sell Browse Buy Sell e-commerce app 必要な時に新しくDL

Slide 23

Slide 23 text

Dynamic Delivery

Slide 24

Slide 24 text

Dynamic Delivery • 後からfeature moduleをDL可能 • コードpush的な使い方は出来ない
 (各feature moduleのversion codeは合わせる必要ある) • moduleを選択出来るのでA/Bテストみたいな使い方も出来そう

Slide 25

Slide 25 text

Develop
 Android App Bundle

Slide 26

Slide 26 text

Environment

Slide 27

Slide 27 text

Environment 
 dependencies { classpath “com.android.tools.build:gradle:3.2.0-alpha14” }

Slide 28

Slide 28 text

Build App Bundle

Slide 29

Slide 29 text

Build App Bundle 
 $ ./gradlew [module]:bundleVariant e.g.
 ./gradlew bundleDevRelease

Slide 30

Slide 30 text

Build App Bundle 
 module/build/outputs/bundleVariant/bundle.aab

Slide 31

Slide 31 text

Publish bundle.aab

Slide 32

Slide 32 text

Publish bundle.aab

Slide 33

Slide 33 text

Prepare keystore 
 $ java -jar pepk.jar \
 --keystore=[your keystore] \ --alias=[keystore alias] \
 --output=[encrypted_private_key] \
 --encryptionkey=[hogehogehoge]

Slide 34

Slide 34 text


 $ java -jar pepk.jar \
 --keystore=[your keystore] \ --alias=[keystore alias] \
 --output=[encrypted_private_key] \
 --encryptionkey=[hogehogehoge] Prepare keystore storeからDL

Slide 35

Slide 35 text


 $ java -jar pepk.jar \
 --keystore=[your keystore] \ --alias=[keystore alias] \
 --output=[encrypted_private_key] \
 --encryptionkey=[hogehogehoge] Prepare keystore 既存のkeystoreを指定

Slide 36

Slide 36 text


 $ java -jar pepk.jar \
 --keystore=[your keystore] \ --alias=[keystore alias] \
 --output=[encrypted_private_key] \
 --encryptionkey=[hogehogehoge] Prepare keystore keystoreのaliasを指定

Slide 37

Slide 37 text


 $ java -jar pepk.jar \
 --keystore=[your keystore] \ --alias=[keystore alias] \
 --output=[encrypted_private_key] \
 --encryptionkey=[hogehogehoge] Prepare keystore 任意のファイル名

Slide 38

Slide 38 text


 $ java -jar pepk.jar \
 --keystore=[your keystore] \ --alias=[keystore alias] \
 --output=[encrypted_private_key] \
 --encryptionkey=[hogehogehoge] Prepare keystore storeに表示されているkeyを指定

Slide 39

Slide 39 text

Publish bundle.aab

Slide 40

Slide 40 text

bundle tool google/bundletool https://github.com/google/bundletool

Slide 41

Slide 41 text

bundle tool 
 $ bundletool build-apks \
 --bundle= \ --output=


Slide 42

Slide 42 text

bundle tool $ mkdir apks
 $ unzip out.apks -d apks

Slide 43

Slide 43 text

bundle tool $ ls base-hdpi.apk base-master.apk base-tvdpi.apk base-xxhdpi.apk standalone-hdpi.apk standalone-mdpi.apk standalone-xhdpi.apk standalone-xxxhdpi.apk base-ldpi.apk base-mdpi.apk base-xhdpi.apk base-xxxhdpi.apk standalone-ldpi.apk standalone-tvdpi.apk standalone-xxhdpi.apk toc.pb

Slide 44

Slide 44 text

bundle tool $ bundletool get-device-spec \
 --output= \ 接続端末の情報を出力

Slide 45

Slide 45 text

bundle tool $ bundletool get-device-spec \
 --output= \ { "supportedAbis": ["arm64-v8a", "armeabi-v7a"], "supportedLocales": ["en-US"], "screenDensity": 640, "sdkVersion": 27 } Pixel2.json

Slide 46

Slide 46 text

bundle tool $ bundletool extract-apks \
 --apks= \ --output-dir= \ --device-spec=pixel2.json

Slide 47

Slide 47 text

bundle tool $ bundletool extract-apks \
 --apks= \ --output-dir= \ --device-spec=pixel2.json

Slide 48

Slide 48 text

bundle tool $ bundletool extract-apks \
 --apks= \ --output-dir= \ --device-spec=pixel2.json

Slide 49

Slide 49 text

bundle tool $ bundletool extract-apks \
 --apks= \ --output-dir= \ --device-spec=pixel2.json

Slide 50

Slide 50 text

bundle tool $ ls base-master.apk base-xxxhdpi.apk
 base-arm64_v8.apk base-en.apk

Slide 51

Slide 51 text

bundle tool android { splits { language { enable true include "en", "ja" } density { enable true } abi { enable true } } }

Slide 52

Slide 52 text

bundle tool android { splits { language { enable true include "en", "ja" } density { enable true } abi { enable true } } } 言語ファイルの分割

Slide 53

Slide 53 text

bundle tool android { splits { language { enable true include "en", "ja" } density { enable true } abi { enable true } } } 画面サイズの分割

Slide 54

Slide 54 text

bundle tool android { splits { language { enable true include "en", "ja" } density { enable true } abi { enable true } } } CPU命令セットの分割

Slide 55

Slide 55 text

bundle tool android { splits { language { enable true include "en", "ja" } density { enable true } abi { enable false } } } 分割不要ならfalse

Slide 56

Slide 56 text

bundle tool android { generatePureSplits true splits { language { enable true include "en", "ja" } density { enable true } abi { enable true } } }

Slide 57

Slide 57 text

bundle tool android { generatePureSplits true splits { language { enable true include "en", "ja" } ɹɹ… multi apk, instant appsで使われてる

Slide 58

Slide 58 text

bundle tool android { generatePureSplits true splits { language { enable true include "en", "ja" } ɹɹ… min SDK21以上 multi apk, instant appsで使われてる

Slide 59

Slide 59 text

bundle tool 通常のbuildで分割される (↑instant apps)

Slide 60

Slide 60 text

bundle tool applicationはフォルダ内で分割されて出力

Slide 61

Slide 61 text

Appendixes

Slide 62

Slide 62 text

Sample Project AAkira/DaggerInstantApps https://goo.gl/7xqb5M 既存アプリへのInstantApps導入
 @DroidKaigi2018 https://goo.gl/b7kHhf

Slide 63

Slide 63 text

Instant Apps 10MBまで配布可能に! https://g.co/instantapps/10mb

Slide 64

Slide 64 text

YouTube Links https://youtu.be/ 9D63S4ZRBls https://youtu.be/ httqEshs_Bk https://youtu.be/ 0raqVydJmNE https://youtu.be/ bViNOUeFuiQ

Slide 65

Slide 65 text

Summary

Slide 66

Slide 66 text

Summary • App Bundleの対応は凄く簡単なので、
 次のリリースからすぐに対応可能 • Dynamic Deliveryはコードpushではない • これからのアプリはmodule化が必須 • 今後InstantApps, Dynamic Deliveryはデフォルト構成に

Slide 67

Slide 67 text

Summary Googlerと話したほうが良い
 
 2日目のSandboxで2時間
 3日目のOffice Hourで2時間

Slide 68

Slide 68 text

@_a_akira AAkira Thanks