Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
What's new in Android 2018
Search
GDG Montreal
November 25, 2018
Technology
0
48
What's new in Android 2018
This a deck that Google provide to share what is new in Android 2018.
GDG Montreal
November 25, 2018
Tweet
Share
More Decks by GDG Montreal
See All by GDG Montreal
Advanced Pregnancy Risk Assessment Using AI Model Chain by Kiruthika Subramani
gdgmontreal
0
9
Al and Security: A double edge sword? by Stacy Véronneau and Yan Bellerose
gdgmontreal
0
11
Scaling AI on a Budget: A Startup's GPU Optimization Journey by Shannon Lal
gdgmontreal
0
10
Build Your Own Secured AI Platform with Google Cloud Vertex AI by unleashing the Power of Multi-LLM by Eckarath Khounsombath
gdgmontreal
0
17
FlutterMTL_-_Flutter_Next_24.pdf
gdgmontreal
0
7
Developing Flutter Applications in Dev Container Environments - Ali Yazdi
gdgmontreal
0
7
Building an ML powered Android Livestreaming App by Etienne Caron
gdgmontreal
0
13
Boosting Your Mobile App: Small Details, Big Impact by Mathieu Fillion
gdgmontreal
0
7
The Hitchhiker's Guide to MLOps by David Cardozo
gdgmontreal
0
6
Other Decks in Technology
See All in Technology
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.4k
Terraform Stacks入門 #HashiTalks
msato
0
360
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.7k
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
Amazon Personalizeのレコメンドシステム構築、実際何するの?〜大体10分で具体的なイメージをつかむ〜
kniino
1
100
いざ、BSC討伐の旅
nikinusu
2
780
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
サイバーセキュリティと認知バイアス:対策の隙を埋める心理学的アプローチ
shumei_ito
0
390
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.4k
AGIについてChatGPTに聞いてみた
blueb
0
130
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
13k
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Building an army of robots
kneath
302
43k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Scaling GitHub
holman
458
140k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Ruby is Unlike a Banana
tanoku
97
11k
Optimizing for Happiness
mojombo
376
70k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Teambox: Starting and Learning
jrom
133
8.8k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Transcript
What’s new in Android @L_de_V Laurence de Villers
What’s New In Android PI A s
Android App Bundle
Source: Partner provided data 5 10 15 20 25 30
35 40 45 50 55 60 65 70 75 80 85 90 95 100 APK size (MBs) Conversion rate decreases as apps get larger Play Store conversion rate (% of visitors who install) Trendline
xxhdpi hdpi xhdpi mdpi ldpi xxxhdpi
xxhdpi arm hdpi arm xhdpi arm mdpi arm ldpi arm
xxxhdpi arm xxhdpi x86 hdpi x86 xhdpi x86 mdpi x86 ldpi x86 xxxhdpi x86
xxhdpi arm64 hdpi arm64 xhdpi arm64 mdpi arm64 ldpi arm64
xxxhdpi arm64 xxhdpi arm hdpi arm xhdpi arm mdpi arm ldpi arm xxxhdpi arm xxhdpi x86 hdpi x86 xhdpi x86 mdpi x86 ldpi x86 xxxhdpi x86 xxhdpi x86_64 hdpi x86_64 xhdpi x86_64 mdpi x86_64 ldpi x86_64 xxxhdpi x86_64
xxhdpi arm64 v:14 hdpi arm64 v: 16 xhdpi arm64 v:15
mdpi arm64 v:17 ldpi arm64 v:18 xxxhdpi arm64 v:13 xxhdpi arm v:20 hdpi arm v:22 xhdpi arm v:21 mdpi arm v:23 ldpi arm v:24 xxxhdpi arm v:19 xxhdpi x86 v: 8 hdpi x86 v:10 xhdpi x86 v:9 mdpi x86 v: 11 ldpi x86 v:12 xxxhdpi x86 v: 7 xxhdpi x86_64 v: 2 hdpi x86_64 v: 4 xhdpi x86_64 v:3 mdpi x86_64 v:5 ldpi x86_64 v: 6 xxxhdpi x86_64 v: 1
Android App Bundle Benefit from a smaller app Stop managing
multiple APKs Deliver features on-demandBETA
Source: Partner provided data saving 11% saving 23% saving 45%
saving 22% 28% saving ABA English Airbnb LinkedIn Perigee saving 49% RV AppStudios saving 64% Memrise Pluto. TV
Optimized APK for each device Upload an Android App Bundle
Dynamic Delivery
/res/xxxhdpi classes.dex /res/xxhdpi config_xxxhdpi.apk base.apk config_xxxhdpi.apk /res/xhdpi /res/hdpi config_xhdpi.apk config_hdpi.apk
/res/mhdpi /res/ldpi config_mhdpi.apk config_ldpi.apk /lib/x86 /lib/arm config_x86.apk config_arm.apk /res/values-en /res/values-fr config_en.apk config_fr.apk /res/values-es config_es.apk …
App Bundle APK
Android App Bundle Start today at g.co/androidappbundle
Android Jetpack Accelerate App Development
None
95% supported devices
Refactor android.support.v4.* android.support.v7.* // etc. androidx.*
Jetpack Architecture
Jetpack Architecture Lifecycle Lifecycle Aware Components
Jetpack Architecture Lifecycle Lifecycle Aware Components ViewModel View data decoupled
from OS lifecycle
Jetpack Architecture Lifecycle Lifecycle Aware Components ViewModel View data decoupled
from OS lifecycle Room SQLite object mapping
Jetpack Architecture Lifecycle Lifecycle Aware Components ViewModel View data decoupled
from OS lifecycle Room SQLite object mapping LiveData Lifecycle aware observables
Jetpack Architecture Lifecycle Lifecycle Aware Components ViewModel View data decoupled
from OS lifecycle Paging (1.0!) Asynchronous data retrieval Room SQLite object mapping LiveData Lifecycle aware observables
Jetpack Architecture WorkManager Job scheduling Navigation Backstack and app flows
PREVIEW
View Models Simplifying Android development
What is the hardest part of Android Development?
None
ViewModel onCleared()
ViewModel + LiveData onCleared() observe LiveData
ViewModel + LiveData onCleared() LiveData observe
ViewModel + LiveData onCleared() LiveData observe
ViewModel + LiveData onCleared() LiveData
ViewModel + LiveData onCleared() LiveData observe
ViewModel + LiveData onCleared() LiveData observe
ViewModel + LiveData onCleared() LiveData observe
ViewModel + LiveData onCleared() LiveData
Room A better way to do databases
2016: How do you do Databases on Android?
Database SQLite App Logic Content Provider
Database Uri App Logic Content Provider SQLite
Database Content Values Uri App Logic Content Provider SQLite
App Logic Content Provider Database Content Values Uri SQLite Not
type-safe
App Logic Content Provider Database Content Values Uri SQLite Not
type-safe Not type-safe
App Logic Content Provider Database Content Values Uri SQLite Not
type-safe Not type-safe
Room Database App Logic Content Provider Content Values Uri Not
type-safe Not type-safe SQLite
Room DAO SQLite
Room SQL DAO View Model SQLite Type-safe
Room SQL Entities DAO View Model Type-safe Type-safe SQLite
WorkManager Backwards compatible background work PREVIEW
Battery Optimizations Optimize background tasks to stay charged longer
Unlimited Background Services Doze App Standby Limited Broadcasts Release Wakelocks
Service Limitations App Standby Buckets Background Restrictions
There is still a lot of work to do Sending
logs Uploading images and videos Syncing data Processing data
Basic Work: upload a photo upload
// A simple Worker class UploadPhotoWorker : Worker() { override
fun doWork(): WorkerResult { uploadPhoto() return WorkerResult.SUCCESS } } SUCCESS FAILURE RETRY Runs on a background thread
// Creating a work request and enqueuing it val request:
WorkRequest = OneTimeWorkRequestBuilder<UploadPhotoWorker>().build() WorkManager.getInstance().enqueue(request) Ω
What if you lose connectivity? Use constraints!
// Creating a work request with network constraints val constraints
= Constraints.Builder() .setRequiredNetworkType(NetworkType.CONNECTED) .build() val request = OneTimeWorkRequestBuilder<UploadPhotoWorker>() .setConstraints(constraints) .build() WorkManager.getInstance().enqueue(request)
Show Progress upload
Chain Work compress upload
Parallel Work upload
Complex Flows filter filter filter compress upload
When to use? Best-Effort Exact Timing ThreadPool Coroutines ThreadPool Coroutines
When to use? Best-Effort Guaranteed Execution Exact Timing Deferrable ThreadPool
Coroutines ThreadPool Coroutines Foreground Service
WorkManager Respects users battery Works with OS Backwards compatible (API14)
Navigation How to get around your app PREVIEW
Challenges for navigation Fragment Transactions Deep Links Passing Arguments Up
and Back Errorprone Boilerplate Testing
Home Category Item https://... Need to be created and added
to back stack on deep link
Navigation Graph A navigation graph is a blueprint of screens
and the actions that link them.
Navigation Define navigation graph with visual tool / XML: Make
a single navigate() call and runtime library handles everything
None
Safe Args Type-safe arguments when launching a Fragment
HelpFragment.kt if (!arguments.containsKey("screenName")) { throw IllegalArgumentException() } val category: Int
= arguments.getInt("category") val screenName: String = arguments.getString("screenName")
HomeFragment.kt findViewById<Button>(R.id.help_button).setOnClickListener { v -> val helpDirections = HomeFragmentDirections.help("Home") helpDirections.category
= 1703 v.findNavController().navigate(helpDirections) }
HelpFragment.kt val args : HelpFragmentArgs = HelpFragmentArgs.fromBundle(arguments) val screenName: String
= args.screenName val category: Int = args.category
Navigation IDE tooling for app navigation Manage deeplinks Safe argument
passing
Jetpack Architecture Start today at d.android.com/arch
Integration Tests e2e Tests Unit Tests Android Test Part of
Jetpack
@RunWith(AndroidJUnit4::class) class SimpleUnifiedTest { @Test fun viewIsVisible() { assertEquals(view.visibility, View.VISIBLE)
} } Failed: Expected 0 but was 16 F
@RunWith(AndroidJUnit4::class) class SimpleUnifiedTest { @Test fun viewIsVisible() { assertThat(view).isVisible() }
} Failed: View was not visible F NEW
Core Platform changes in Android Pie
Battery App Standby Buckets usage based access to jobs, alarms,
network, messaging Background Restriction user can restrict badly-behaved apps
Background Inputs & Privacy
Kotlin Performance & Compiler ART, D8, R8 Nullability support library
and libcore
Android KTX Part of Jetpack Concise, readable code. A suite
of libraries Android KTX, Testing KTX, ...
Background Text Measurement Text measurement is expensive Up to 80
to 90% of the draw/measure/layout loop Pre-computed text API offloads most of the work to a worker thread PrecomputedText.create(...)
Baseline distance
val tv: TextView // Distance from top to first baseline
tv.firstBaselineToTopHeight = distancePx // Distance from bottom to last baseline tv.lastBaselineToBottomHeight = distancePx NEW
Security Unified BiometricDialog @deprecated FingerprintManager Stronger protection for private keys
StrongBox backend Build.SERIAL doesn’t work anymore
System UI Integrating fully with Android
Display Cutouts Simulate notches in developer options (skip the electrical
tape) WindowInsets#getDisplayCutout() android:windowLayoutInDisplayCutoutMode • mode=”never” • mode=”default” • mode=”shortEdges” + DisplayCutout#getSafeInsets() • mode=”shortEdges” + DisplayCutout#getBounds()
Slices A new approach to remote content • Within an
app or between apps • Structured data, flexible templates • Interactive, updatable • Backwards-compatible! • (Support Library, KitKat/API 19+)
Actions Deep links into your app • “shortcuts with parameters”
• “a visible Intent” Define actions in actions.xml Register with App Indexing to show as on-device search results
Notifications People love messages …so we focused on MessagingStyle •
Inline images/stickers • Participant images • Smart reply UI • RemoteInput.setChoices() And more!
What’s New In Android Android App Bundle https://g.co/androidappbundle Android Jetpack
https://d.android.com/jetpack https://d.android.com/kotlin https://d.android.com/arch https://d.android.com/arch/navigation https://d.android.com/arch/workmanager Core Platform App Standby Buckets Background Restrictions System UI Display Cutouts Slices & Actions Notifications
Thank You!