SlideShare a Scribd company logo
Google IO 2019
Key Updates
Android
Hello!
I am Sunita Singh
I’m an Android Developer at Copper Mobile, Inc.
2
Android Q
What’s new in Android Q
1
Latest Android Q Updates
● Bubbles
● Dark Theme Support
● Sharing improvements
● Notifications
● Gesture Navigation and more.
4
Bubbles
Easy multi tasking
● Bubbles are built into the Notification system.
● They float on top of different app content and
follow the user wherever they’re going.
● Bubbles can be expanded to reveal app
functionality and information, and might be
collapsed when not getting used.
E.g. in facebook messenger app.
Sample: https://github.com/googlesamples/android-
Bubbles
For more info:
https://developer.android.com/preview/features/bubbles
Place your screenshot
here
5
Dark Theme
Those eyes won’t hurt anymore
● Can reduce power usage by a significant amount.
● Improves visibility for users with low vision and those who
are sensitive to bright light.
● Strongly recommended that apps support dark theme.
● Force Dark feature automatically convert app to the dark
theme (make ‘forceDarkAllowed’ to true).
How to use?
<style name="AppTheme" parent="Theme.AppCompat.DayNight">
OR
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
For more info :
https://developer.android.com/preview/features/darktheme
6
Sharing
Improvements
Updated with a new design & APIs
● The Direct Sharing API has been replaced with new
sharing shortcut APIs
● Greatly improved performance.
● Simplified & enhanced UI.
● More Developer customization options.
Sample: https://github.com/googlesamples/android-
SharingShortcuts
For more information:
https://developer.android.com/preview/features/sharing
Place your screenshot
here
7
Notification
Gentle & Priority, Notification Actions
● Helps organize valuable & important
notifications.
● Initially configured by developers, but can be
adjusted by users & system.
● Directly access related deeplinks.
● Quick reply with suggested responses.
● Can Generate smart replies with Firebase MLKit.
Place your screenshot
here
8
Gesture Navigation
● Only 2 navigation methods will be supported in the
Android platform from Q:
○ 3 buttons
○ Model moving forward.
● Making your app nav-ready:-
○ Make Your UI edge-to-edge.
○ Leverage insets for better UI.
○ Override system gestures.
● App can face conflicts with any horizontally-draggable
content (Sliders, Seekbars etc).
● Common scenarios where app can face problem with
gestures: Scrolling Views, Navigation Drawers, Bottom
Sheets, Landscape mode, Carousels (ViewPager etc).
● New API available in Q to opt out at least the back
gesture.
Place your screenshot
here
9
Accessibility
● One liner for accessibility actions
ViewCompat.addAccessibilityAction(...)
● Vary duration of transient UI
AccessibilityManager.getRecommendedTimeout
Millis (default:Int, flags: Int)
10
Text
Improve Text Performance
● Hyphenation: Hyphenation is OFF by default in Android Q & AppCompat V1.1.0. To re-
enable hyphenation:
<TextView android: hyphenationFrequency=”normal”/>
● PreComputedText:
○ Use PreComputedText with Recyclerview prefetch.
○ For more info: https://medium.com/google-developers/recyclerview-prefetch-
c2f269075710
https://medium.com/androiddevelopers/prefetch-text-layout-in-recyclerview-
4acf9103f438
Custom Fonts
● Use CustomFallbackBuilder to support multiple fonts
E.g. We want an image in between text, text having custom font (lato).
● Max 64 font families while building Typeface using CustomFallbackBuilder.
● Conceptually different font families can not be put in same Font family object.
11
Text
Some more..
Styling Text
● Style, Theme, TextAppearance, View Attribute, Span.
System Fonts
● 270+ pre-installed fonts.
● Find fonts used by system: FontMatcher API (NDK).
● Find installed fonts: FontEnumeration API.
Editable Text
● Now Error message of Edittext will not hide behind the keyboard.
● If you want the keyboard to learn about your password then use
android:inputType=”textVisiblePassword”
● If you don't want the keyboard to learn about your password then use
android:inputType=”textPassword”
● Use IME flags to configure soft keyboard.
12
for(font in SystemFonts.getAvailableFonts()){
//choose your font here.
}
Magnifier
● Android magnifier widget. Can be used by any view which is
attached to a window.
● The magnifier is already integrated with platform widgets
such as TextView, EditText, or WebView.
● It provides consistent text manipulation across applications.
● The widget comes with a simple API and can be used to
magnify anyView depending on your application’s context.
View view = findViewById(R.id.view);
Magnifier magnifier = new Magnifier(view);
magnifier.show(view.getWidth() / 2, view.getHeight() / 2);
Place your screenshot
here
13
Runtime Permissions
For all the apps running on Android Q
● Prevention of silent access to reading screen content
READ_FRAME_BUFFER, CAPTURE_VIDEO_OUTPUT,
CAPTURE_SCREEN_VIDEO_OUTPUT
● Instead use MediaProjection API with user’s consent
● Opportunity for the user to revoke already granted
permission when user updates to Q for the first time
● New permission ACTIVITY_RECOGNITION added to
track walking, biking or cycling activities of the user.
● Permission groups are removed from UI
Place your screenshot
here
14
Security
● Immutable device identifiers will no longer be
available via READ_PHONE_STATE e.g.
Build, IMEI, ESN, SIM etc.
● Mac address randomization.
● App launching & notifications.
● Declare service type in Manifest for services
15
<service
android:foregroundServiceType=”location”/>
Kotlin
● New Apis in Q have nullability annotations.
● Nullability enforced as an errors instead of warnings with Q.
● Incremental annotation processing with kapt in 1.3.30
● Coroutines support for Workmanager, Room, LifeCycle, LiveData, ViewModel.
● Jetpack Compose.
● Kotlin plugin part for Android Studio.
● Lint support for kotlin added
16
Android Jetpack
To make the development easier and faster
2
CameraX
Jetpack camera support library
● Camera development is hard because of OS flavors and the Camera API complexity etc.
● Issues tackled in previous camera API:
○ Front/back camera switch crashes.
○ Optimized camera closures etc.
● Backwards compatibility to L (90% devices).
● Easy to use and Consistent behavior across all android devices.
● CameraX benefits:
○ Reduced device specific testing.
○ 75% reduction in lines of code.
○ Smaller apk size etc.
● CameraX is lifecycle aware Easy to use.so you don’t need to start & stop cameraX.
● CameraX hides all the internal functionality from you & maintain it by own.
18
Jetpack Navigation
Jetpack library to manage in-app UI flows
● Now can navigate by URI (<deeplink>).
● ViewModel scoped to navigation graphs.
● Can use dialog destinations.
● CodeLabs sample:
https://codelabs.developers.google.com/codelabs/android-
navigation/#0
● Safe Args (Gradle plugin):
Escorting your arguments safely to their destination
apply plugin: “androidx.navigation.safeargs” (for java)
apply plugin: “androidx.navigation.safeargs.kotlin” (for kotlin)
19
Jetpack Compose
Next generation UI toolkit
● Reactive
● A kotlin compiler plugin.
● Fully compatible with your existing app/code.
@Composable
fun Greeting(name : String) {
Text(“Hello $name”)
}
● For More info: https://developer.android.com/jetpack/compose
20
ViewPager 2
● Like viewPager, but better
● Based on recyclerview
● RTL mode support
● Allows vertical paging.
● Improved dataset change notifications.
dependencies {
implementation 'androidx.viewpager2:viewpager2:1.0.0-alpha04'
}
● offscreenPageLimit: allows for a tight control of the number of page
Views / Fragments kept in the view hierarchy.
21
ViewBindings
Coming soon in Android Studio 3.6
● Compatible with Data Binding.
● Full Studio integration.
● 100% compile time safety
● Binding classes built by Gradle Plugin.
val binding = ProfileBinding.inflate(layoutInflater)
setContentView(binding.root)
22
SavedState for ViewModel
ViewModel + SavedState
● ViewModel and SavedState are used for different purposes & not same.
● ViewModel works as a cache for heavy objects.
● SavedState used for small data.
class UserViewModel (val handle : SavedStateHandle) : ViewModel(){}
● Syntax for ViewModel initialization:
val viewModel : UserViewModel by ViewModels()
23
WorkManager
Background processing library
● Persistence
● Backwards compatibility (API 14)
● On-demand initialization
● Robolectric support available now
● Create test workers using TestWorkBuilder & TestListenableBuilder.
24
Room
SQL object mapping library
● Coroutines support.
● You can have suspend method for getting data, insert data etc.
@Query(“select * from Song where songId=songId”)
suspend fun getSong (songId : String) : Song
@Insert
suspend fun insertSong(song : Song)
● Full Text Search (@ Fts4 annotation)
● Database Views
● Expanded Rx support
@Insert
fun addSong(song : Song) : Completable
25
Android AI Tools
To make your app smarter
3
AI Tools
● MLKit
● Google Cloud
● TensorFlow (open source)
● For more info look here:
https://firebase.google.com/docs/ml-kit
https://cloud.google.com/solutions/mobile/
https://www.tensorflow.org/lite/guide/android
27
MLKit
● Existing Features
○ Vision: Landmark detection, Image labeling, Barcode Scanning,
Face detection.
○ Natural Language: Language identification, Smart Reply.
○ Custom: Model Serving.
● New features:
○ On-device translation: fast and dynamic translation for 59
languages.
○ Object detection and tracking.
28
Miscellaneous Updates
4
Android Studio 3.5 beta
Project Marble
● System health
○ Fixed UI Freezes
○ Speed & CPU usage
○ Automatic leak detection
● Feature Polish
○ Apply changes
○ Project upgrades
○ Offline
○ Gradle Sync
● Bug Backlog
○ Layout editor improvements etc.
30
ConstraintLayout (2.x)
● Flexibility
○ Virtual layouts
○ Helpers & Decorators
○ Programming APIs
implementation ‘com.android.support.constraint:constraint-
layout:2.0.0.beta1’
● MotionLayout
○ Subclass of constraint layout.
Sample code for MotionLayout: https://github.com/googlesamples/android-ConstraintLayoutExamples
31
Blend Modes
● android.graphics.BlendMode replaces PorterDuff Mode (deprecated in
android Q)
● New modes available:
○ HARD_LIGHT
○ SOFT_LIGHT etc.
32
RenderNode
● Efficient rendering (used by views internally)
● Contains:
○ Display list
○ Display properties
● Can be hierarchical (RenderNode can contain another RenderNode).
● Cast shadows without a view.
if (canvas.isHardwareAccelerated()) {
canvas.drawRenderNode(myRenderNode);
}
33
Settings Panel
● Settings UI directly within app (Internet, NFC, Volume,
WiFi).
val intent = Intent(
Settings.Panel.ACTION_INTERNET_CONNECTIVITY
)
startActivityForResult(intent,0)
34
35
Thanks!
Got an app idea? We are the
experts!
Reach out to us via https://www.coppermobile.com/contact-us/

More Related Content

PPTX
Android study jams 2021 [collab] [master]
PPTX
Android study jams 1
PPTX
Android Study Jams Session 01
PPTX
Study Jam Session 2
PPTX
Vit bhopal android study jams 2.0 session 1
PPTX
Android study jam iiitv kick-off sesson
PPTX
Week 1 - Android Study Jams
PPTX
Android study jams iiitv sesion 3
Android study jams 2021 [collab] [master]
Android study jams 1
Android Study Jams Session 01
Study Jam Session 2
Vit bhopal android study jams 2.0 session 1
Android study jam iiitv kick-off sesson
Week 1 - Android Study Jams
Android study jams iiitv sesion 3

What's hot (20)

PPTX
Intro session kotlin
PDF
Android Workshop Part 1
PPTX
Android Study Jam - Info Session
PPTX
Final session 1
PPTX
Android development-tutorial
PPTX
Info session on android study jams
PDF
Android tutorial
PDF
Android Study Jam 2021 Session 4 slides
PPTX
Android study jam
PPTX
Android study jam session 1
PPTX
The First Ever Android Meet-up
PDF
Android study jams info session 2021 new GDSC GECBSP
PDF
Android Study Jams Session 2 - Android Basics in Kotlin
PDF
GDSC GECBSP Android Study Jams Session 3
PDF
30 days gcp info session final
PPTX
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
PPTX
ASJ Workshop - Introduction
PDF
Android Studio vs. ADT
PPTX
Lecture #1 Creating your first android project
PPTX
Creating the first app with android studio
Intro session kotlin
Android Workshop Part 1
Android Study Jam - Info Session
Final session 1
Android development-tutorial
Info session on android study jams
Android tutorial
Android Study Jam 2021 Session 4 slides
Android study jam
Android study jam session 1
The First Ever Android Meet-up
Android study jams info session 2021 new GDSC GECBSP
Android Study Jams Session 2 - Android Basics in Kotlin
GDSC GECBSP Android Study Jams Session 3
30 days gcp info session final
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
ASJ Workshop - Introduction
Android Studio vs. ADT
Lecture #1 Creating your first android project
Creating the first app with android studio
Ad

Similar to Google I/O 2019 - what's new in Android Q and Jetpack (20)

PDF
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
PPTX
What's new in android M(6.0)
PDF
Innovation Generation - The Mobile Meetup: Android Best Practices
PDF
Android workshop material
PPT
ANDROID presentation prabal
PDF
What’s new for Developers in IBM Domino & Domino Designer 9.0.1
PPTX
Android Lollipop: The developer's perspective
PDF
Android Jump Start
PDF
JSFest 2019: Technology agnostic microservices at SPA frontend
PPTX
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
PDF
Rapid and Reliable Developing with HTML5 & GWT
PDF
Running Code in the Android Stack at ABS 2014
PDF
Android Best Practices - Thoughts from the Trenches
PDF
Running Code in the Android Stack at ELCE 2013
PDF
What's new in Android Pie
PPTX
Android crash course
PDF
Rhomobile 5.5 Release Notes
PDF
Introduction to Android M
PPTX
Chapter 1- Mobile Application Development Introduction-java.pptx
PDF
Android development - the basics, MFF UK, 2012
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
What's new in android M(6.0)
Innovation Generation - The Mobile Meetup: Android Best Practices
Android workshop material
ANDROID presentation prabal
What’s new for Developers in IBM Domino & Domino Designer 9.0.1
Android Lollipop: The developer's perspective
Android Jump Start
JSFest 2019: Technology agnostic microservices at SPA frontend
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
Rapid and Reliable Developing with HTML5 & GWT
Running Code in the Android Stack at ABS 2014
Android Best Practices - Thoughts from the Trenches
Running Code in the Android Stack at ELCE 2013
What's new in Android Pie
Android crash course
Rhomobile 5.5 Release Notes
Introduction to Android M
Chapter 1- Mobile Application Development Introduction-java.pptx
Android development - the basics, MFF UK, 2012
Ad

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Cloud computing and distributed systems.
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Modernizing your data center with Dell and AMD
A Presentation on Artificial Intelligence
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Approach and Philosophy of On baking technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
The Rise and Fall of 3GPP – Time for a Sabbatical?
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
The AUB Centre for AI in Media Proposal.docx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Cloud computing and distributed systems.
Chapter 3 Spatial Domain Image Processing.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced methodologies resolving dimensionality complications for autism neur...
Review of recent advances in non-invasive hemoglobin estimation
Digital-Transformation-Roadmap-for-Companies.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Modernizing your data center with Dell and AMD

Google I/O 2019 - what's new in Android Q and Jetpack

  • 1. Google IO 2019 Key Updates Android
  • 2. Hello! I am Sunita Singh I’m an Android Developer at Copper Mobile, Inc. 2
  • 3. Android Q What’s new in Android Q 1
  • 4. Latest Android Q Updates ● Bubbles ● Dark Theme Support ● Sharing improvements ● Notifications ● Gesture Navigation and more. 4
  • 5. Bubbles Easy multi tasking ● Bubbles are built into the Notification system. ● They float on top of different app content and follow the user wherever they’re going. ● Bubbles can be expanded to reveal app functionality and information, and might be collapsed when not getting used. E.g. in facebook messenger app. Sample: https://github.com/googlesamples/android- Bubbles For more info: https://developer.android.com/preview/features/bubbles Place your screenshot here 5
  • 6. Dark Theme Those eyes won’t hurt anymore ● Can reduce power usage by a significant amount. ● Improves visibility for users with low vision and those who are sensitive to bright light. ● Strongly recommended that apps support dark theme. ● Force Dark feature automatically convert app to the dark theme (make ‘forceDarkAllowed’ to true). How to use? <style name="AppTheme" parent="Theme.AppCompat.DayNight"> OR <style name="AppTheme" parent="Theme.MaterialComponents.DayNight"> For more info : https://developer.android.com/preview/features/darktheme 6
  • 7. Sharing Improvements Updated with a new design & APIs ● The Direct Sharing API has been replaced with new sharing shortcut APIs ● Greatly improved performance. ● Simplified & enhanced UI. ● More Developer customization options. Sample: https://github.com/googlesamples/android- SharingShortcuts For more information: https://developer.android.com/preview/features/sharing Place your screenshot here 7
  • 8. Notification Gentle & Priority, Notification Actions ● Helps organize valuable & important notifications. ● Initially configured by developers, but can be adjusted by users & system. ● Directly access related deeplinks. ● Quick reply with suggested responses. ● Can Generate smart replies with Firebase MLKit. Place your screenshot here 8
  • 9. Gesture Navigation ● Only 2 navigation methods will be supported in the Android platform from Q: ○ 3 buttons ○ Model moving forward. ● Making your app nav-ready:- ○ Make Your UI edge-to-edge. ○ Leverage insets for better UI. ○ Override system gestures. ● App can face conflicts with any horizontally-draggable content (Sliders, Seekbars etc). ● Common scenarios where app can face problem with gestures: Scrolling Views, Navigation Drawers, Bottom Sheets, Landscape mode, Carousels (ViewPager etc). ● New API available in Q to opt out at least the back gesture. Place your screenshot here 9
  • 10. Accessibility ● One liner for accessibility actions ViewCompat.addAccessibilityAction(...) ● Vary duration of transient UI AccessibilityManager.getRecommendedTimeout Millis (default:Int, flags: Int) 10
  • 11. Text Improve Text Performance ● Hyphenation: Hyphenation is OFF by default in Android Q & AppCompat V1.1.0. To re- enable hyphenation: <TextView android: hyphenationFrequency=”normal”/> ● PreComputedText: ○ Use PreComputedText with Recyclerview prefetch. ○ For more info: https://medium.com/google-developers/recyclerview-prefetch- c2f269075710 https://medium.com/androiddevelopers/prefetch-text-layout-in-recyclerview- 4acf9103f438 Custom Fonts ● Use CustomFallbackBuilder to support multiple fonts E.g. We want an image in between text, text having custom font (lato). ● Max 64 font families while building Typeface using CustomFallbackBuilder. ● Conceptually different font families can not be put in same Font family object. 11
  • 12. Text Some more.. Styling Text ● Style, Theme, TextAppearance, View Attribute, Span. System Fonts ● 270+ pre-installed fonts. ● Find fonts used by system: FontMatcher API (NDK). ● Find installed fonts: FontEnumeration API. Editable Text ● Now Error message of Edittext will not hide behind the keyboard. ● If you want the keyboard to learn about your password then use android:inputType=”textVisiblePassword” ● If you don't want the keyboard to learn about your password then use android:inputType=”textPassword” ● Use IME flags to configure soft keyboard. 12 for(font in SystemFonts.getAvailableFonts()){ //choose your font here. }
  • 13. Magnifier ● Android magnifier widget. Can be used by any view which is attached to a window. ● The magnifier is already integrated with platform widgets such as TextView, EditText, or WebView. ● It provides consistent text manipulation across applications. ● The widget comes with a simple API and can be used to magnify anyView depending on your application’s context. View view = findViewById(R.id.view); Magnifier magnifier = new Magnifier(view); magnifier.show(view.getWidth() / 2, view.getHeight() / 2); Place your screenshot here 13
  • 14. Runtime Permissions For all the apps running on Android Q ● Prevention of silent access to reading screen content READ_FRAME_BUFFER, CAPTURE_VIDEO_OUTPUT, CAPTURE_SCREEN_VIDEO_OUTPUT ● Instead use MediaProjection API with user’s consent ● Opportunity for the user to revoke already granted permission when user updates to Q for the first time ● New permission ACTIVITY_RECOGNITION added to track walking, biking or cycling activities of the user. ● Permission groups are removed from UI Place your screenshot here 14
  • 15. Security ● Immutable device identifiers will no longer be available via READ_PHONE_STATE e.g. Build, IMEI, ESN, SIM etc. ● Mac address randomization. ● App launching & notifications. ● Declare service type in Manifest for services 15 <service android:foregroundServiceType=”location”/>
  • 16. Kotlin ● New Apis in Q have nullability annotations. ● Nullability enforced as an errors instead of warnings with Q. ● Incremental annotation processing with kapt in 1.3.30 ● Coroutines support for Workmanager, Room, LifeCycle, LiveData, ViewModel. ● Jetpack Compose. ● Kotlin plugin part for Android Studio. ● Lint support for kotlin added 16
  • 17. Android Jetpack To make the development easier and faster 2
  • 18. CameraX Jetpack camera support library ● Camera development is hard because of OS flavors and the Camera API complexity etc. ● Issues tackled in previous camera API: ○ Front/back camera switch crashes. ○ Optimized camera closures etc. ● Backwards compatibility to L (90% devices). ● Easy to use and Consistent behavior across all android devices. ● CameraX benefits: ○ Reduced device specific testing. ○ 75% reduction in lines of code. ○ Smaller apk size etc. ● CameraX is lifecycle aware Easy to use.so you don’t need to start & stop cameraX. ● CameraX hides all the internal functionality from you & maintain it by own. 18
  • 19. Jetpack Navigation Jetpack library to manage in-app UI flows ● Now can navigate by URI (<deeplink>). ● ViewModel scoped to navigation graphs. ● Can use dialog destinations. ● CodeLabs sample: https://codelabs.developers.google.com/codelabs/android- navigation/#0 ● Safe Args (Gradle plugin): Escorting your arguments safely to their destination apply plugin: “androidx.navigation.safeargs” (for java) apply plugin: “androidx.navigation.safeargs.kotlin” (for kotlin) 19
  • 20. Jetpack Compose Next generation UI toolkit ● Reactive ● A kotlin compiler plugin. ● Fully compatible with your existing app/code. @Composable fun Greeting(name : String) { Text(“Hello $name”) } ● For More info: https://developer.android.com/jetpack/compose 20
  • 21. ViewPager 2 ● Like viewPager, but better ● Based on recyclerview ● RTL mode support ● Allows vertical paging. ● Improved dataset change notifications. dependencies { implementation 'androidx.viewpager2:viewpager2:1.0.0-alpha04' } ● offscreenPageLimit: allows for a tight control of the number of page Views / Fragments kept in the view hierarchy. 21
  • 22. ViewBindings Coming soon in Android Studio 3.6 ● Compatible with Data Binding. ● Full Studio integration. ● 100% compile time safety ● Binding classes built by Gradle Plugin. val binding = ProfileBinding.inflate(layoutInflater) setContentView(binding.root) 22
  • 23. SavedState for ViewModel ViewModel + SavedState ● ViewModel and SavedState are used for different purposes & not same. ● ViewModel works as a cache for heavy objects. ● SavedState used for small data. class UserViewModel (val handle : SavedStateHandle) : ViewModel(){} ● Syntax for ViewModel initialization: val viewModel : UserViewModel by ViewModels() 23
  • 24. WorkManager Background processing library ● Persistence ● Backwards compatibility (API 14) ● On-demand initialization ● Robolectric support available now ● Create test workers using TestWorkBuilder & TestListenableBuilder. 24
  • 25. Room SQL object mapping library ● Coroutines support. ● You can have suspend method for getting data, insert data etc. @Query(“select * from Song where songId=songId”) suspend fun getSong (songId : String) : Song @Insert suspend fun insertSong(song : Song) ● Full Text Search (@ Fts4 annotation) ● Database Views ● Expanded Rx support @Insert fun addSong(song : Song) : Completable 25
  • 26. Android AI Tools To make your app smarter 3
  • 27. AI Tools ● MLKit ● Google Cloud ● TensorFlow (open source) ● For more info look here: https://firebase.google.com/docs/ml-kit https://cloud.google.com/solutions/mobile/ https://www.tensorflow.org/lite/guide/android 27
  • 28. MLKit ● Existing Features ○ Vision: Landmark detection, Image labeling, Barcode Scanning, Face detection. ○ Natural Language: Language identification, Smart Reply. ○ Custom: Model Serving. ● New features: ○ On-device translation: fast and dynamic translation for 59 languages. ○ Object detection and tracking. 28
  • 30. Android Studio 3.5 beta Project Marble ● System health ○ Fixed UI Freezes ○ Speed & CPU usage ○ Automatic leak detection ● Feature Polish ○ Apply changes ○ Project upgrades ○ Offline ○ Gradle Sync ● Bug Backlog ○ Layout editor improvements etc. 30
  • 31. ConstraintLayout (2.x) ● Flexibility ○ Virtual layouts ○ Helpers & Decorators ○ Programming APIs implementation ‘com.android.support.constraint:constraint- layout:2.0.0.beta1’ ● MotionLayout ○ Subclass of constraint layout. Sample code for MotionLayout: https://github.com/googlesamples/android-ConstraintLayoutExamples 31
  • 32. Blend Modes ● android.graphics.BlendMode replaces PorterDuff Mode (deprecated in android Q) ● New modes available: ○ HARD_LIGHT ○ SOFT_LIGHT etc. 32
  • 33. RenderNode ● Efficient rendering (used by views internally) ● Contains: ○ Display list ○ Display properties ● Can be hierarchical (RenderNode can contain another RenderNode). ● Cast shadows without a view. if (canvas.isHardwareAccelerated()) { canvas.drawRenderNode(myRenderNode); } 33
  • 34. Settings Panel ● Settings UI directly within app (Internet, NFC, Volume, WiFi). val intent = Intent( Settings.Panel.ACTION_INTERNET_CONNECTIVITY ) startActivityForResult(intent,0) 34
  • 35. 35 Thanks! Got an app idea? We are the experts! Reach out to us via https://www.coppermobile.com/contact-us/