Top Banner
Lick my Lollipop #MoMoSlo
59
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lick my Lollipop

Lick my Lollipop

#MoMoSlo

Page 2: Lick my Lollipop

Željko PlesacAndroid developer at

Infinum SI

[email protected]

Page 3: Lick my Lollipop

What are the main drawbacks of Android OS?

Page 4: Lick my Lollipop

• Static design

• Battery drainage

• Over heating

• Lagging (it’s really slow after few months of usage)

• Decentralized - it lacks central Android body to address the grievance of its users.

• Fragmentation

Page 5: Lick my Lollipop

Solution for all of our problems?

Page 6: Lick my Lollipop
Page 7: Lick my Lollipop

Say hello to Android 5.0/L/Lollipop!

Page 8: Lick my Lollipop
Page 9: Lick my Lollipop

What’s new in Android 5.0. Lollipop?

Page 10: Lick my Lollipop

Material design

Page 11: Lick my Lollipop

• brand new Android design theme/principles

• main goals:

1. Material is the metaphor

2. Bold, graphic, intentional

3. Motion provides meaning

Page 13: Lick my Lollipop

Interfaces should be “bold, graphic, intentional”

Page 14: Lick my Lollipop

Logo

Page 15: Lick my Lollipop

LogoSurfaces and shadows

Page 16: Lick my Lollipop

Tiny details

Page 17: Lick my Lollipop

One design to conquer them all

Page 18: Lick my Lollipop

Enhanced notifications

Page 19: Lick my Lollipop

New ways to control when and how you receive messages

Page 20: Lick my Lollipop

High-priority notifications are presented to users for a short period of time with an expanded layout exposing possible actions

Page 21: Lick my Lollipop

Priority mode for fewer disruptions

Page 22: Lick my Lollipop

View and respond to messages directly from your lock screen

Page 23: Lick my Lollipop

ART

Page 24: Lick my Lollipop

• Android apps are deployed in Dalvik bytecode, which is portable, unlike native code. In order to be able to run the app on a device, the code has to be compiled to machine code.

• older versions of Android use Dalvik VM

• based on JIT (just in time) compilation

• each time you run an app, the part of the code required for its execution is going to be translated (compiled) to machine code at that moment

• it has a smaller memory footprint and uses less physical space on the device.

Page 25: Lick my Lollipop

• Android 5.0 runs exclusively on the ART runtime, which offers ahead-of-time (AOT) compilation

• The whole code of the app will be pre-compiled during install (once)

Page 26: Lick my Lollipop

Why is this good?

Page 27: Lick my Lollipop

• With no need for JIT compilation, the code should execute much faster

• it doesn't hit the CPU as hard as just-in-time code compiling on Dalvik (also, results in less battery drain)

Page 28: Lick my Lollipop

Any downsides?

Page 29: Lick my Lollipop

• the generated machine code requires more space than the existing bytecode

• the code is pre-compiled at install time, so the installation process takes a bit longer

• larger memory footprint at execution time (fewer apps run concurrently)

Page 30: Lick my Lollipop

Interested in statistics/benchmark?

Page 31: Lick my Lollipop

• 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

• Install times on my Nexus 4, for one of our larger projects, jumped from ~17 s to ~25 s.

(tested on Kitkat 4.4.4, should be even faster now)

Page 32: Lick my Lollipop

Project Volta

Page 33: Lick my Lollipop

Android 5.0 emphasizes improvements in battery life:

1. Scheduling jobs

2. Developer tools for battery usage

Page 34: Lick my Lollipop

1. Scheduling jobs• Android 5.0 provides a new JobScheduler API that lets you

optimize battery life by defining jobs for the system to run asynchronously (at a later time or under specified condition)

• The app has non-user-facing work that you can defer.

• The app has work you'd prefer to do when the unit is plugged in.

• The app has a task that requires network access or a Wi-Fi connection.

• The app has a number of tasks that you want to run as a batch on a regular schedule.

Page 35: Lick my Lollipop

• You can schedule the task to run under specific conditions, such as:

• Start when the device is charging

• Start when the device is connected to an unmetered network

• Start when the device is idle

• Finish before a certain deadline or with a minimum delay

Page 36: Lick my Lollipop

2. Developer tools for battery usage

• The new dumpsys batterystats command generates interesting statistical data about battery usage on a device, organized by unique user ID (UID):

• History of battery related events

• Global statistics for the device

• Approximate power use per UID and system component

• Per-app mobile ms per packet

• System UID aggregated statistics

• App UID aggregated statistics

Page 37: Lick my Lollipop

WebView updates

Page 38: Lick my Lollipop

• since the release of Android 4.4 KitKat, WebView has been based on Chromium (it has the same rendering and Javascript engine as Chrome for Android)

• WebView is now unbundled from the system and will be regularly updated through Google Play.

• every mobile device with Android 5 or later should have not only the same but the latest browsing engine in the WebView

Page 39: Lick my Lollipop

Multiple network connections

Page 40: Lick my Lollipop

• Android 5.0 provides new multi-networking APIs that let your app dynamically scan for available networks with specific capabilities, and establish a connection to them

• useful when your app requires a specialized network, such as an SUPL, MMS, or carrier-billing network, or if you want to send data using a particular type of transport protocol.

Page 41: Lick my Lollipop

New Camera and Audio API

Page 42: Lick my Lollipop

• Android 5.0 introduces the new android.hardware.camera2 API to facilitate fine-grain photo capture and image processing

• Use the new notification and media APIs to ensure that the system UI knows about your media playback and can extract and show album art.

• Controlling media playback across a UI and a service is now a lot easier

• ability for apps to browse the media content library of another app

Page 43: Lick my Lollipop

Security

Page 44: Lick my Lollipop

• encryption is automatically turned on to help protect data on lost or stolen devices

• Android Smart Lock - secure your phone or tablet by pairing it with a trusted device like your wearable or even your car

Page 45: Lick my Lollipop

Cross device synchronization

Page 46: Lick my Lollipop

• ability to pair up different devices (tablet + Android wear + smartphone + Android TV) in one system

• applications are optimised for every device

• songs, photos, apps, and even recent searches from one of your Android devices can be immediately enjoyed across all of your Android devices

Page 47: Lick my Lollipop

Multi dex support

Page 48: Lick my Lollipop
Page 49: Lick my Lollipop
Page 50: Lick my Lollipop

• Dalvik VM has one major limitation which we didn’t discuss yet:

APK HAS UPPER LIMIT OF 65,536 METHODS!

Page 51: Lick my Lollipop

• ART natively supports loading multiple .dex files from application APK files.

• ART performs pre-compilation at application install time which scans for classes(..N).dex files and compiles them into a single .oat file for execution by the Android device

• Android build tools construct a primary dex (classes.dex) and supporting (classes2.dex, classes3.dex) as needed. The build system will then package them into an APK file for distribution.

Page 52: Lick my Lollipop

and much more…

Page 53: Lick my Lollipop

• BLE Peripheral Mode - Android devices can now function in Bluetooth Low Energy (BLE) peripheral mod

• Managed provisioning and unified view of apps

• OpenGL ES 3.1 and Android Extension Pack

• 64-bit support

• Print preview and page range support

• better integration with OK Google

• Concurrent documents in Overview

• Android Work

Page 54: Lick my Lollipop

Bonus :)

Page 55: Lick my Lollipop

• Android Studio 1.0 RC 1 has been released to Canary channel

• Material design has already been integrated to Android Support Library

• Google Play Services Granular Dependency Management - you’ll be able to depend only on the parts of Google Play services that you use by utilizing separate libraries for each API.

Page 56: Lick my Lollipop

Fun times are coming!

Page 57: Lick my Lollipop

Thanks!

Page 58: Lick my Lollipop

[email protected]

skype: zeljko.plesac

twitter: @ZeljkoPlesac

Page 59: Lick my Lollipop

Fin.