SlideShare a Scribd company logo
1 of 35
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

What's hot

Android Workshop Part 1
Android Workshop Part 1Android Workshop Part 1
Android Workshop Part 1NAILBITER
 
Android Study Jam - Info Session
Android Study Jam - Info SessionAndroid Study Jam - Info Session
Android Study Jam - Info SessionAITIKDANDAPAT
 
Android development-tutorial
Android development-tutorialAndroid development-tutorial
Android development-tutorialilias ahmed
 
Info session on android study jams
Info session on android study jamsInfo session on android study jams
Info session on android study jamsArjavDesai3
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorialmaster760
 
Android Study Jam 2021 Session 4 slides
Android Study Jam 2021 Session 4 slidesAndroid Study Jam 2021 Session 4 slides
Android Study Jam 2021 Session 4 slidesBoston Android
 
Android study jam session 1
Android study jam session 1Android study jam session 1
Android study jam session 1DSCIIITLucknow
 
The First Ever Android Meet-up
The First Ever Android Meet-upThe First Ever Android Meet-up
The First Ever Android Meet-upvriddhigupta
 
Android study jams info session 2021 new GDSC GECBSP
Android study jams info session 2021 new GDSC GECBSPAndroid study jams info session 2021 new GDSC GECBSP
Android study jams info session 2021 new GDSC GECBSPDomendra Sahu
 
Android Study Jams Session 2 - Android Basics in Kotlin
Android Study Jams Session 2 - Android Basics in KotlinAndroid Study Jams Session 2 - Android Basics in Kotlin
Android Study Jams Session 2 - Android Basics in KotlinDomendra Sahu
 
GDSC GECBSP Android Study Jams Session 3
GDSC GECBSP Android Study Jams Session 3GDSC GECBSP Android Study Jams Session 3
GDSC GECBSP Android Study Jams Session 3Domendra Sahu
 
30 days gcp info session final
30 days gcp info session final30 days gcp info session final
30 days gcp info session finalDomendra Sahu
 
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENMAndroid Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENMGDSCBVCOENM
 
ASJ Workshop - Introduction
ASJ Workshop - IntroductionASJ Workshop - Introduction
ASJ Workshop - IntroductionAmsavarthan Lv
 
Lecture #1 Creating your first android project
Lecture #1  Creating your first android projectLecture #1  Creating your first android project
Lecture #1 Creating your first android projectVitali Pekelis
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studioParinita03
 

What's hot (20)

Intro session kotlin
Intro session kotlinIntro session kotlin
Intro session kotlin
 
Android Workshop Part 1
Android Workshop Part 1Android Workshop Part 1
Android Workshop Part 1
 
Android Study Jam - Info Session
Android Study Jam - Info SessionAndroid Study Jam - Info Session
Android Study Jam - Info Session
 
Final session 1
Final session 1Final session 1
Final session 1
 
Android development-tutorial
Android development-tutorialAndroid development-tutorial
Android development-tutorial
 
Info session on android study jams
Info session on android study jamsInfo session on android study jams
Info session on android study jams
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android Study Jam 2021 Session 4 slides
Android Study Jam 2021 Session 4 slidesAndroid Study Jam 2021 Session 4 slides
Android Study Jam 2021 Session 4 slides
 
Android study jam
Android study jamAndroid study jam
Android study jam
 
Android study jam session 1
Android study jam session 1Android study jam session 1
Android study jam session 1
 
The First Ever Android Meet-up
The First Ever Android Meet-upThe First Ever Android Meet-up
The First Ever Android Meet-up
 
Android study jams info session 2021 new GDSC GECBSP
Android study jams info session 2021 new GDSC GECBSPAndroid study jams info session 2021 new GDSC GECBSP
Android study jams info session 2021 new GDSC GECBSP
 
Android Study Jams Session 2 - Android Basics in Kotlin
Android Study Jams Session 2 - Android Basics in KotlinAndroid Study Jams Session 2 - Android Basics in Kotlin
Android Study Jams Session 2 - Android Basics in Kotlin
 
GDSC GECBSP Android Study Jams Session 3
GDSC GECBSP Android Study Jams Session 3GDSC GECBSP Android Study Jams Session 3
GDSC GECBSP Android Study Jams Session 3
 
30 days gcp info session final
30 days gcp info session final30 days gcp info session final
30 days gcp info session final
 
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENMAndroid Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
 
ASJ Workshop - Introduction
ASJ Workshop - IntroductionASJ Workshop - Introduction
ASJ Workshop - Introduction
 
Android Studio vs. ADT
Android Studio vs. ADTAndroid Studio vs. ADT
Android Studio vs. ADT
 
Lecture #1 Creating your first android project
Lecture #1  Creating your first android projectLecture #1  Creating your first android project
Lecture #1 Creating your first android project
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studio
 

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

Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...DicodingEvent
 
What's new in android M(6.0)
What's new in android M(6.0)What's new in android M(6.0)
What's new in android M(6.0)Yonatan Levin
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesSolstice Mobile Argentina
 
Android workshop material
Android workshop materialAndroid workshop material
Android workshop materialReza Yogaswara
 
ANDROID presentation prabal
ANDROID presentation prabalANDROID presentation prabal
ANDROID presentation prabalPrabal Tyagi
 
What’s new for Developers in IBM Domino & Domino Designer 9.0.1
What’s new for Developers in IBM Domino & Domino Designer 9.0.1What’s new for Developers in IBM Domino & Domino Designer 9.0.1
What’s new for Developers in IBM Domino & Domino Designer 9.0.1IBM Connections Developers
 
Android Lollipop: The developer's perspective
Android Lollipop: The developer's perspectiveAndroid Lollipop: The developer's perspective
Android Lollipop: The developer's perspectiveSebastian Vieira
 
Android Jump Start
Android Jump StartAndroid Jump Start
Android Jump StartHaim Michael
 
JSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontendJSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontendVlad Fedosov
 
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JSFestUA
 
Rapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTRapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTManuel Carrasco Moñino
 
Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Opersys inc.
 
Android Best Practices - Thoughts from the Trenches
Android Best Practices - Thoughts from the TrenchesAndroid Best Practices - Thoughts from the Trenches
Android Best Practices - Thoughts from the TrenchesAnuradha Weeraman
 
Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Opersys inc.
 
What's new in Android Pie
What's new in Android PieWhat's new in Android Pie
What's new in Android PieHassan Abid
 
Rhomobile 5.5 Release Notes
Rhomobile 5.5 Release NotesRhomobile 5.5 Release Notes
Rhomobile 5.5 Release NotesKonstantin Rybas
 
Introduction to Android M
Introduction to Android MIntroduction to Android M
Introduction to Android Mamsanjeev
 
Android development - the basics, MFF UK, 2012
Android development - the basics, MFF UK, 2012Android development - the basics, MFF UK, 2012
Android development - the basics, MFF UK, 2012Tomáš Kypta
 
What's new in android 4.4 - Romain Guy & Chet Haase
What's new in android 4.4 - Romain Guy & Chet HaaseWhat's new in android 4.4 - Romain Guy & Chet Haase
What's new in android 4.4 - Romain Guy & Chet HaaseParis Android User Group
 

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

Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
 
What's new in android M(6.0)
What's new in android M(6.0)What's new in android M(6.0)
What's new in android M(6.0)
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best Practices
 
Android workshop material
Android workshop materialAndroid workshop material
Android workshop material
 
ANDROID presentation prabal
ANDROID presentation prabalANDROID presentation prabal
ANDROID presentation prabal
 
What’s new for Developers in IBM Domino & Domino Designer 9.0.1
What’s new for Developers in IBM Domino & Domino Designer 9.0.1What’s new for Developers in IBM Domino & Domino Designer 9.0.1
What’s new for Developers in IBM Domino & Domino Designer 9.0.1
 
Android Lollipop: The developer's perspective
Android Lollipop: The developer's perspectiveAndroid Lollipop: The developer's perspective
Android Lollipop: The developer's perspective
 
Android Jump Start
Android Jump StartAndroid Jump Start
Android Jump Start
 
JSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontendJSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontend
 
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
 
Rapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTRapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWT
 
Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014
 
Android Best Practices - Thoughts from the Trenches
Android Best Practices - Thoughts from the TrenchesAndroid Best Practices - Thoughts from the Trenches
Android Best Practices - Thoughts from the Trenches
 
Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013
 
What's new in Android Pie
What's new in Android PieWhat's new in Android Pie
What's new in Android Pie
 
Android crash course
Android crash courseAndroid crash course
Android crash course
 
Rhomobile 5.5 Release Notes
Rhomobile 5.5 Release NotesRhomobile 5.5 Release Notes
Rhomobile 5.5 Release Notes
 
Introduction to Android M
Introduction to Android MIntroduction to Android M
Introduction to Android M
 
Android development - the basics, MFF UK, 2012
Android development - the basics, MFF UK, 2012Android development - the basics, MFF UK, 2012
Android development - the basics, MFF UK, 2012
 
What's new in android 4.4 - Romain Guy & Chet Haase
What's new in android 4.4 - Romain Guy & Chet HaaseWhat's new in android 4.4 - Romain Guy & Chet Haase
What's new in android 4.4 - Romain Guy & Chet Haase
 

Recently uploaded

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

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/