SlideShare ist ein Scribd-Unternehmen logo
1 von 59
Android N 7.0
DevFest 2016 event, Iqra University, Karachi
Presenter: Imam Raza
Speaker.bio.toString()
Senior Software Architect @ Folio3
Specialities:
Enterprise Software Architecture,
Mobile Software Architecture
About this presentation
me.loveQuestion==true. Let's have interactive session
The content is designed on basis of industry experience.
Love to do hands-on coding session but this session is not hands-on. Why?
See in later slides
Switching the gear with interesting silicon valley facts.
Agenda
Android Marketing Statistics
Android N
Market Statistic shared in DevFest 2012
Today Market Statistic
9 in every 10 smartphones is
Android
Switching the gear
A mandatory books for all silicon
valley graduates seeking jobs.
Android N
What’s new in Android N?
Multi-Window Support
Notifications
JIT/AOT Compilation
Quick Path to App Install
Doze on the Go
Background Optimizations
SurfaceView
Number Blocking
Call Screening
Locales and Languages
New Emojis
ICU4J APIs in Android
WebView
OpenGL ES 3.2 API
Key Attestation
Network Security Config
Default Trusted CA
APK Signature Scheme v2
Scoped Directory Access
Keyboard Shortcuts Helper
Custom Pointer API
So many things to cover in 60min Session
Chose my fight for today session
Android Compiler
Recent Google strategy seems to removing the old intermediary java bytecode .class all
together. why? Due to Google dispute with Oracle over use of Java?
Android Runtime
A journey that starts with Dalvik VM and now ends removing dalvik completely. Why Google
has to throw away its dalvik vm?
Webview
How it will impact the cross-platform development app? how to keep webview changes be
tested before it is released some easy option.
Android Compiler
Q: Why Android need a new
compiler?
Benefits of Jack
Completely open source
Available in AOSP; partners are welcome to contribute.
Speeds compilation time
Jack has specific supports to reduce compilation time: pre-dexing,
incremental compilation and a Jack compilation server.
Handles shrinking, obfuscation, repackaging and multidex
Using a separate package such as ProGuard is no longer necessary.
Compilation Prior to Jack/Jill
Compilation with Jack/Jill
If we want to use Java 8 language feature set in Android then Jack toolchain
is must. Remember Android doesn’t support all Java 8 features as of now.
Jack is must for Java 8 language features
How to use Jack/Jill in Gradle for
compilation
Known Issues
Instant Run does not currently work.
Tools that work on generated .class file would not work e.g
Lint detectors that operate on class files
Tools and libraries that require the app’s class files (such as instrumentation tests with
JaCoCo)
Switching the gear
Zareen is a pakistani restaurant in
Google Mountain View.
1477 Plymouth Street, Suite C
Mountain View, CA 94043
http://www.zareensrestaurant.com/
Android Runtime
Dalvik Vs ART
Timeline
Prior to Kitakat 4.4, android OS has only dalvik as runtime.
In Kitkat 4.4, Google introduced ART alongside with Dalvik as an experiment
and let user select the runtime from developer options.
Timeline
Lollipop 5.0 ART completely replaced Dalvik. App become fast but
installation start taking time.
Marshmallow 6.0 ART some fixes.
Android N added Just in Time (JIT) compiler with code profiling to ART that
fixes app installation time problem.
Dalvik Vs ART(Android RunTime)
● Dalvik is JIT(Just in time compiler) that
translate app code into machine code
when the app is run.
● As you progress through the app,
additional code is going to be compiled
and cached, so that the system can reuse
the code while the app is running.
● It has a smaller memory footprint and uses
less physical space on the device
● ART, is AOT(Ahead of Time) compiler
that compiles the intermediate language,
Dalvik bytecode, into a system-
dependent binary.
● The whole code of the app will be pre-
compiled during install (once), thus
removing the lag that we see when we
open an app on the device.
● As ART runs app machine code directly
(native execution), it doesn't hit the CPU
as hard as just-in-time code compiling on
Dalvik
ART Some benchmark shared by android
police
increased speed in CPU floating operations by approx. 20%
increased speed in RAM operations by approx. 10%
increased speed in storage operations by approx. 10
CPU integer operations - slight advantage goes to Dalvik
ART Downside
The code is pre-compiled at app install time, so the installation
process takes a bit longer.
The generated machine code requires more space than the existing bytecode
With Android N faster App installation and
System Update
How?
Android N Hybrid Runtime
Profile-guided JIT/AOT Compilation
Android N Hybride Runtime with JIT/AOT
There won’t be any compilation during install, and applications can be
started right away, the bytecode being interpreted.
There is a new, faster interpreter in ART accompanied by a new JIT, but the
JIT information is not persisted.
The code is profiled during execution and the resulted data is saved. Later,
when the device is idle and charging, ART will perform a profile-based
compilation of the hot sections of the code, the rest remaining untouched.
While this procedure is still called AOT for simplicity, it can be read All-Of-
Android N Hybride Runtime with JIT/AOT
Switching the gear
Silicon valley awakes early in the
morning
WebView
Why bother for WebView?
cross-platform framework
Ionic, Sencha ,phonegap
Make use of Webview
Multiprocess Webview
Multiprocess Architecture
Multiprocess Webview
Starting with Chrome version 51 in Android 7.0, WebView will run web
content in a separate sandboxed process when the developer option
"Multiprocess WebView" is enabled.
one of the benefits of multiprocess is the ability to run the renderer in 32-bit
to save memory even when webview is being used by a 64-bit app.
Javascript run before page load
Javascript context will be reset when a new page is loaded.
Currently, the context is carried over for the first page loaded in a new
WebView instance.
Developers looking to inject Javascript into the WebView should execute the
script after the page has started to load.
Geolocation on insecure origins
Geolocation API will only be allowed on secure origins (over HTTPS.)
This policy is designed to protect users’ private information when they’re
using an insecure connection.
Production problems of cross-platform apps
Due to webview updates
Just like any native application, cross-platform apps usually have issues
when webview is changed with the release of OS sdk API.
The impact of webview changes has lot on cross-platform app, as the whole
app is running under webview. So webview is like OS for cross-platform
app.
How to test app with Webview Beta updates
Testing with Webview Beta
Testing with Webview Beta
Switching the gear
Silicon valley folks are casual and
funny.
Doze
Q:What does Doze mean?
Lets ask Google translator
What is Android Doze?
A system mode that
saves battery by deferring apps'
CPU and
network activities
when the device is idle
Doze on the Go
Doze introduced in Android 6.0 MarshMallow
Android 7.0, Doze takes a step further and saves battery while on the go.
Any time the screen is off for a period of time and the device is unplugged,
Doze applies a subset of the familiar CPU and network restrictions to
apps. This means users can save battery even when carrying their devices
in their pockets.
Android N Doze
Doze Restriction
Network access is suspended.
GCM messages are suspended. Only high-priority GCM messages are
delivered.
The system ignores wake locks.
Standard AlarmManager alarms (including setExact() and setWindow()) are
deferred to the next maintenance window.
The system does not perform Wi-Fi scans.
Conditions that exit Doze restriction
The user explicitly launches the app.
The app has a process currently in the foreground (either as an activity or
foreground service, or in use by another activity or foreground service).
The app generates a notification that users see on the lock screen or in the
notification tray.
When the user plugs the device into a power supply.
Can I Whitelist App from Doze?
An app that is whitelisted can use the network and hold partial wake locks
during Doze and App Standby.
However, other restrictions still apply to the whitelisted app, just as they do
to other apps. e.g the whitelisted app’s jobs and syncs are deferred (on API
level 23 and below), and its regular AlarmManager alarms do not fire.
User can whitelist app from Doze
Apps can request for whitelisting from Doze
An app can fire the ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS
intent to take the user directly to the Battery Optimization, where they can
add the app.
An app holding the REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
permission can trigger a system dialog to let the user add the app to the
whitelist directly, without going to settings. The app fires a
ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS Intent to trigger
the dialog.
How to test app against Doze
$ adb shell dumpsys battery unplug
$ adb shell am set-inactive <packageName> true
Questions

Weitere ähnliche Inhalte

Was ist angesagt?

Modern Functional Test Automation Through Visual AI - webinar w/ Raja Rao
Modern Functional Test Automation Through Visual AI - webinar w/ Raja Rao Modern Functional Test Automation Through Visual AI - webinar w/ Raja Rao
Modern Functional Test Automation Through Visual AI - webinar w/ Raja Rao
Applitools
 

Was ist angesagt? (20)

React Native: Is It Worth It? UA Mobile 2017.
React Native: Is It Worth It? UA Mobile 2017.React Native: Is It Worth It? UA Mobile 2017.
React Native: Is It Worth It? UA Mobile 2017.
 
Refactoring Wunderlist. UA Mobile 2016.
Refactoring Wunderlist. UA Mobile 2016.Refactoring Wunderlist. UA Mobile 2016.
Refactoring Wunderlist. UA Mobile 2016.
 
How to setup unit testing in Android Studio
How to setup unit testing in Android StudioHow to setup unit testing in Android Studio
How to setup unit testing in Android Studio
 
[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android
 
Android testing
Android testingAndroid testing
Android testing
 
Appium solution
Appium solutionAppium solution
Appium solution
 
Testing on Android
Testing on AndroidTesting on Android
Testing on Android
 
React native vs. ionic – which one is better and why
React native vs. ionic – which one is better and why React native vs. ionic – which one is better and why
React native vs. ionic – which one is better and why
 
Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013
 
Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?
 
Android Programming made easy
Android Programming made easyAndroid Programming made easy
Android Programming made easy
 
Android Automation Using Robotium
Android Automation Using RobotiumAndroid Automation Using Robotium
Android Automation Using Robotium
 
How to Test Security and Vulnerability of Your Android and iOS Apps
How to Test Security and Vulnerability of Your Android and iOS AppsHow to Test Security and Vulnerability of Your Android and iOS Apps
How to Test Security and Vulnerability of Your Android and iOS Apps
 
Appium & Jenkins
Appium & JenkinsAppium & Jenkins
Appium & Jenkins
 
Hassle-Free Continuous Integration with Real Device Testing
Hassle-Free Continuous Integration with Real Device TestingHassle-Free Continuous Integration with Real Device Testing
Hassle-Free Continuous Integration with Real Device Testing
 
Android 6.0 Marshmallow - Everything you need to know !
Android 6.0 Marshmallow - Everything you need to know !Android 6.0 Marshmallow - Everything you need to know !
Android 6.0 Marshmallow - Everything you need to know !
 
Top 8 Alternatives Of Xamarin.pdf
Top 8 Alternatives Of Xamarin.pdfTop 8 Alternatives Of Xamarin.pdf
Top 8 Alternatives Of Xamarin.pdf
 
The Best Alternatives To The Ionic Framework.pdf
The Best Alternatives To The Ionic Framework.pdfThe Best Alternatives To The Ionic Framework.pdf
The Best Alternatives To The Ionic Framework.pdf
 
Modern Functional Test Automation Through Visual AI - webinar w/ Raja Rao
Modern Functional Test Automation Through Visual AI - webinar w/ Raja Rao Modern Functional Test Automation Through Visual AI - webinar w/ Raja Rao
Modern Functional Test Automation Through Visual AI - webinar w/ Raja Rao
 
Automated Testing and Continuous Deployment for Mobile Apps with Jenkins
Automated Testing and Continuous Deployment for Mobile Apps with Jenkins Automated Testing and Continuous Deployment for Mobile Apps with Jenkins
Automated Testing and Continuous Deployment for Mobile Apps with Jenkins
 

Andere mochten auch

Android presentation
Android presentationAndroid presentation
Android presentation
Imam Raza
 
Big Data University ML0101EN Certificate _ Big Data University
Big Data University ML0101EN Certificate _ Big Data UniversityBig Data University ML0101EN Certificate _ Big Data University
Big Data University ML0101EN Certificate _ Big Data University
Imam Raza
 
Google Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talkGoogle Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talk
Imam Raza
 

Andere mochten auch (10)

Android presentation
Android presentationAndroid presentation
Android presentation
 
Apple WWDC 2014 highlights
Apple WWDC 2014 highlightsApple WWDC 2014 highlights
Apple WWDC 2014 highlights
 
Material design
Material designMaterial design
Material design
 
Big Data University ML0101EN Certificate _ Big Data University
Big Data University ML0101EN Certificate _ Big Data UniversityBig Data University ML0101EN Certificate _ Big Data University
Big Data University ML0101EN Certificate _ Big Data University
 
Google Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talkGoogle Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talk
 
LAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android N
 
MBaaS (Mobile Backend As a Service)
MBaaS (Mobile Backend As a Service)MBaaS (Mobile Backend As a Service)
MBaaS (Mobile Backend As a Service)
 
Polymer and web component
Polymer and web componentPolymer and web component
Polymer and web component
 
Google ART (Android RunTime)
Google ART (Android RunTime)Google ART (Android RunTime)
Google ART (Android RunTime)
 
Big Data with hadoop, Spark and BigQuery (Google cloud next Extended 2017 Kar...
Big Data with hadoop, Spark and BigQuery (Google cloud next Extended 2017 Kar...Big Data with hadoop, Spark and BigQuery (Google cloud next Extended 2017 Kar...
Big Data with hadoop, Spark and BigQuery (Google cloud next Extended 2017 Kar...
 

Ähnlich wie GDG Devfest 2016 session on Android N

COMP6210 Web Services And Design Methodologies.docx
COMP6210 Web Services And Design Methodologies.docxCOMP6210 Web Services And Design Methodologies.docx
COMP6210 Web Services And Design Methodologies.docx
write31
 

Ähnlich wie GDG Devfest 2016 session on Android N (20)

Rhomobile 5.5 Release Notes
Rhomobile 5.5 Release NotesRhomobile 5.5 Release Notes
Rhomobile 5.5 Release Notes
 
Android lollipop
Android lollipopAndroid lollipop
Android lollipop
 
What is Codename One - Transcript.pdf
What is Codename One - Transcript.pdfWhat is Codename One - Transcript.pdf
What is Codename One - Transcript.pdf
 
Appium solution artizone
Appium solution   artizoneAppium solution   artizone
Appium solution artizone
 
Mobile UI Testing using Appium and Docker
Mobile UI Testing using Appium and DockerMobile UI Testing using Appium and Docker
Mobile UI Testing using Appium and Docker
 
How to Build a Hybrid App: A Detailed Outline
How to Build a Hybrid App: A Detailed Outline How to Build a Hybrid App: A Detailed Outline
How to Build a Hybrid App: A Detailed Outline
 
Android Stsucture
Android StsuctureAndroid Stsucture
Android Stsucture
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
 
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
JQuery Mobile vs Appcelerator Titanium vs Sencha TouchJQuery Mobile vs Appcelerator Titanium vs Sencha Touch
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
 
PhoneGap JavaScript API vs Native Components
PhoneGap JavaScript API vs Native ComponentsPhoneGap JavaScript API vs Native Components
PhoneGap JavaScript API vs Native Components
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
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
 
COMP6210 Web Services And Design Methodologies.docx
COMP6210 Web Services And Design Methodologies.docxCOMP6210 Web Services And Design Methodologies.docx
COMP6210 Web Services And Design Methodologies.docx
 
What is Android L ?
What is Android L ?What is Android L ?
What is Android L ?
 
Cross-platform mobile that Works - Coobers
Cross-platform mobile that Works - CoobersCross-platform mobile that Works - Coobers
Cross-platform mobile that Works - Coobers
 
Webrtc plugins for Desktop Browsers
Webrtc plugins for Desktop BrowsersWebrtc plugins for Desktop Browsers
Webrtc plugins for Desktop Browsers
 
Android Web app
Android Web app Android Web app
Android Web app
 
Final NEWS.pdf
Final NEWS.pdfFinal NEWS.pdf
Final NEWS.pdf
 
Final NewsApp.pdf
Final NewsApp.pdfFinal NewsApp.pdf
Final NewsApp.pdf
 
Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15
 

Kürzlich hochgeladen

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 

Kürzlich hochgeladen (20)

Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 

GDG Devfest 2016 session on Android N

  • 1. Android N 7.0 DevFest 2016 event, Iqra University, Karachi Presenter: Imam Raza
  • 2. Speaker.bio.toString() Senior Software Architect @ Folio3 Specialities: Enterprise Software Architecture, Mobile Software Architecture
  • 3. About this presentation me.loveQuestion==true. Let's have interactive session The content is designed on basis of industry experience. Love to do hands-on coding session but this session is not hands-on. Why? See in later slides Switching the gear with interesting silicon valley facts.
  • 5. Market Statistic shared in DevFest 2012
  • 7. 9 in every 10 smartphones is Android
  • 8. Switching the gear A mandatory books for all silicon valley graduates seeking jobs.
  • 10. What’s new in Android N? Multi-Window Support Notifications JIT/AOT Compilation Quick Path to App Install Doze on the Go Background Optimizations SurfaceView Number Blocking Call Screening Locales and Languages New Emojis ICU4J APIs in Android WebView OpenGL ES 3.2 API Key Attestation Network Security Config Default Trusted CA APK Signature Scheme v2 Scoped Directory Access Keyboard Shortcuts Helper Custom Pointer API
  • 11. So many things to cover in 60min Session
  • 12. Chose my fight for today session Android Compiler Recent Google strategy seems to removing the old intermediary java bytecode .class all together. why? Due to Google dispute with Oracle over use of Java? Android Runtime A journey that starts with Dalvik VM and now ends removing dalvik completely. Why Google has to throw away its dalvik vm? Webview How it will impact the cross-platform development app? how to keep webview changes be tested before it is released some easy option.
  • 14. Q: Why Android need a new compiler?
  • 15. Benefits of Jack Completely open source Available in AOSP; partners are welcome to contribute. Speeds compilation time Jack has specific supports to reduce compilation time: pre-dexing, incremental compilation and a Jack compilation server. Handles shrinking, obfuscation, repackaging and multidex Using a separate package such as ProGuard is no longer necessary.
  • 16. Compilation Prior to Jack/Jill
  • 18. If we want to use Java 8 language feature set in Android then Jack toolchain is must. Remember Android doesn’t support all Java 8 features as of now. Jack is must for Java 8 language features
  • 19. How to use Jack/Jill in Gradle for compilation
  • 20. Known Issues Instant Run does not currently work. Tools that work on generated .class file would not work e.g Lint detectors that operate on class files Tools and libraries that require the app’s class files (such as instrumentation tests with JaCoCo)
  • 21. Switching the gear Zareen is a pakistani restaurant in Google Mountain View. 1477 Plymouth Street, Suite C Mountain View, CA 94043 http://www.zareensrestaurant.com/
  • 23. Timeline Prior to Kitakat 4.4, android OS has only dalvik as runtime. In Kitkat 4.4, Google introduced ART alongside with Dalvik as an experiment and let user select the runtime from developer options.
  • 24. Timeline Lollipop 5.0 ART completely replaced Dalvik. App become fast but installation start taking time. Marshmallow 6.0 ART some fixes. Android N added Just in Time (JIT) compiler with code profiling to ART that fixes app installation time problem.
  • 25. Dalvik Vs ART(Android RunTime) ● Dalvik is JIT(Just in time compiler) that translate app code into machine code when the app is run. ● As you progress through the app, additional code is going to be compiled and cached, so that the system can reuse the code while the app is running. ● It has a smaller memory footprint and uses less physical space on the device ● ART, is AOT(Ahead of Time) compiler that compiles the intermediate language, Dalvik bytecode, into a system- dependent binary. ● The whole code of the app will be pre- compiled during install (once), thus removing the lag that we see when we open an app on the device. ● As ART runs app machine code directly (native execution), it doesn't hit the CPU as hard as just-in-time code compiling on Dalvik
  • 26. ART Some benchmark shared by android police increased speed in CPU floating operations by approx. 20% increased speed in RAM operations by approx. 10% increased speed in storage operations by approx. 10 CPU integer operations - slight advantage goes to Dalvik
  • 27. ART Downside The code is pre-compiled at app install time, so the installation process takes a bit longer. The generated machine code requires more space than the existing bytecode
  • 28. With Android N faster App installation and System Update
  • 29. How?
  • 30. Android N Hybrid Runtime Profile-guided JIT/AOT Compilation
  • 31. Android N Hybride Runtime with JIT/AOT There won’t be any compilation during install, and applications can be started right away, the bytecode being interpreted. There is a new, faster interpreter in ART accompanied by a new JIT, but the JIT information is not persisted. The code is profiled during execution and the resulted data is saved. Later, when the device is idle and charging, ART will perform a profile-based compilation of the hot sections of the code, the rest remaining untouched. While this procedure is still called AOT for simplicity, it can be read All-Of-
  • 32. Android N Hybride Runtime with JIT/AOT
  • 33. Switching the gear Silicon valley awakes early in the morning
  • 35. Why bother for WebView?
  • 36. cross-platform framework Ionic, Sencha ,phonegap Make use of Webview
  • 39. Multiprocess Webview Starting with Chrome version 51 in Android 7.0, WebView will run web content in a separate sandboxed process when the developer option "Multiprocess WebView" is enabled. one of the benefits of multiprocess is the ability to run the renderer in 32-bit to save memory even when webview is being used by a 64-bit app.
  • 40. Javascript run before page load Javascript context will be reset when a new page is loaded. Currently, the context is carried over for the first page loaded in a new WebView instance. Developers looking to inject Javascript into the WebView should execute the script after the page has started to load.
  • 41. Geolocation on insecure origins Geolocation API will only be allowed on secure origins (over HTTPS.) This policy is designed to protect users’ private information when they’re using an insecure connection.
  • 42. Production problems of cross-platform apps Due to webview updates Just like any native application, cross-platform apps usually have issues when webview is changed with the release of OS sdk API. The impact of webview changes has lot on cross-platform app, as the whole app is running under webview. So webview is like OS for cross-platform app.
  • 43. How to test app with Webview Beta updates
  • 46. Switching the gear Silicon valley folks are casual and funny.
  • 47. Doze
  • 49. Lets ask Google translator
  • 50. What is Android Doze? A system mode that saves battery by deferring apps' CPU and network activities when the device is idle
  • 51. Doze on the Go Doze introduced in Android 6.0 MarshMallow Android 7.0, Doze takes a step further and saves battery while on the go. Any time the screen is off for a period of time and the device is unplugged, Doze applies a subset of the familiar CPU and network restrictions to apps. This means users can save battery even when carrying their devices in their pockets.
  • 53. Doze Restriction Network access is suspended. GCM messages are suspended. Only high-priority GCM messages are delivered. The system ignores wake locks. Standard AlarmManager alarms (including setExact() and setWindow()) are deferred to the next maintenance window. The system does not perform Wi-Fi scans.
  • 54. Conditions that exit Doze restriction The user explicitly launches the app. The app has a process currently in the foreground (either as an activity or foreground service, or in use by another activity or foreground service). The app generates a notification that users see on the lock screen or in the notification tray. When the user plugs the device into a power supply.
  • 55. Can I Whitelist App from Doze? An app that is whitelisted can use the network and hold partial wake locks during Doze and App Standby. However, other restrictions still apply to the whitelisted app, just as they do to other apps. e.g the whitelisted app’s jobs and syncs are deferred (on API level 23 and below), and its regular AlarmManager alarms do not fire.
  • 56. User can whitelist app from Doze
  • 57. Apps can request for whitelisting from Doze An app can fire the ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS intent to take the user directly to the Battery Optimization, where they can add the app. An app holding the REQUEST_IGNORE_BATTERY_OPTIMIZATIONS permission can trigger a system dialog to let the user add the app to the whitelist directly, without going to settings. The app fires a ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS Intent to trigger the dialog.
  • 58. How to test app against Doze $ adb shell dumpsys battery unplug $ adb shell am set-inactive <packageName> true