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
49
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
17
Al and Security: A double edge sword? by Stacy Véronneau and Yan Bellerose
gdgmontreal
0
30
Scaling AI on a Budget: A Startup's GPU Optimization Journey by Shannon Lal
gdgmontreal
0
21
Build Your Own Secured AI Platform with Google Cloud Vertex AI by unleashing the Power of Multi-LLM by Eckarath Khounsombath
gdgmontreal
0
41
FlutterMTL_-_Flutter_Next_24.pdf
gdgmontreal
0
21
Developing Flutter Applications in Dev Container Environments - Ali Yazdi
gdgmontreal
0
91
Building an ML powered Android Livestreaming App by Etienne Caron
gdgmontreal
1
44
Boosting Your Mobile App: Small Details, Big Impact by Mathieu Fillion
gdgmontreal
0
19
The Hitchhiker's Guide to MLOps by David Cardozo
gdgmontreal
0
12
Other Decks in Technology
See All in Technology
Amazon Aurora のバージョンアップ手法について
smt7174
2
150
サイト信頼性エンジニアリングとAmazon Web Services / SRE and AWS
ymotongpoo
7
1.6k
Apache Iceberg Case Study in LY Corporation
lycorptech_jp
PRO
0
340
リクルートのエンジニア組織を下支えする 新卒の育成の仕組み
recruitengineers
PRO
1
100
あなたが人生で成功するための5つの普遍的法則 #jawsug #jawsdays2025 / 20250301 HEROZ
yoshidashingo
2
310
日経のデータベース事業とElasticsearch
hinatades
PRO
0
240
JAWS FESTA 2024「バスロケ」GPS×サーバーレスの開発と運用の舞台裏/jawsfesta2024-bus-gps-serverless
ma2shita
3
240
OSS構成管理ツールCMDBuildを使ったAWSリソース管理の自動化
satorufunai
0
650
ウォンテッドリーのデータパイプラインを支える ETL のための analytics, rds-exporter / analytics, rds-exporter for ETL to support Wantedly's data pipeline
unblee
0
130
Pwned Labsのすゝめ
ken5scal
2
460
事業モメンタムを生み出すプロダクト開発
macchiitaka
0
100
役員・マネージャー・著者・エンジニアそれぞれの立場から見たAWS認定資格
nrinetcom
PRO
4
6.2k
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
380
Music & Morning Musume
bryan
46
6.4k
A Modern Web Designer's Workflow
chriscoyier
693
190k
RailsConf 2023
tenderlove
29
1k
We Have a Design System, Now What?
morganepeng
51
7.4k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.6k
The Invisible Side of Design
smashingmag
299
50k
Into the Great Unknown - MozCon
thekraken
35
1.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
10
1.3k
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!