59
What’s New in Android

What's new in Android Lollipop

Embed Size (px)

Citation preview

What’s New in Android

+ChetHaase @chethaase

+RomainGuy @romainguy

Android 5.0 Lollipop

Nexus SGalaxy Nexus

Nexus 4Nexus 7Nexus 5 Nexus 7

Nexus 10

By the Numbers

Google Play

1 million apps available (July 2013)

50 billion apps downloaded (May 2013)

Devices

1.5 million activations daily (March 2013)

1 billion users (June 2014)

Active Android Users

0

1

2008 2014

(Bill

ions

)

Focus on the User =

Focus on Quality

Project ButterSvelteVolta

ProjectButterSvelteVolta

Project

ButterSvelteVolta

Lollipop

Android DesignMaterial Design

Tangible surfaces

Bold, beautiful aesthetic

Meaningful motion

Adaptive design

Material Design: Learn More About It!

• Material Design spec · www.google.com/design/spec

• Articles, DevBytes, DesignBytes, SDK Reference · developer.android.com

UI Toolkit

New theme

New widgets

New APIs

Material theme

theme=“Android.Material” colors icons touch feedback ripples activity transitions enabled

Theme colors

Grayscale assets tinted by theme colors

colorPrimaryDark colorAccent colorControlNormal colorControlActivated colorControlHighlight colorButtonNormal

Dynamic colors

Palette Derives dominant colors from images Available in v7 support library

Tinting drawables Drawable.setTint() Drawable.setTintMode()

Material Widgets

RecyclerView aka, ListView2

CardView

Both in support library! v7

Material APIs: Graphics

Realtime soft shadows View.setElevation() View.setTranslationZ()

Shaped views and shadows Outline View.setOutlineProvider() View.setClipToOutline()

Material APIs: AnimationsActivity Transitions With shared elements Also, Fragment Transitions!

Animation curves Time and space

Animated Reveal

Material APIs: IconographyTouch feedback ripples RippleDrawable

Vector icons VectorDrawable AnimatedVectorDrawable

State animations StateListAnimator AnimatedStateListDrawable

VectorDrawable<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="128dp" android:width="128dp" android:viewportHeight="480" android:viewportWidth="480" > <group android:name="root" android:translateX="240.0" android:translateY="240.0" > <path android:name="favorite" android:fillColor="#ff000000" android:pathData="M2.100006104,-6 C0.1449127197,-6,1.600006104,-5.975006104,0,-5.975006104 C-1.574996948,-5.975006104,0.00309753418,-6-1.949996948-6 C-4.492996216,-6,-5.949996948,-3.718399048,-5.949996948,-1.149993896 C-5.949996948,2.379302979,-5.699996948,5.100006104,0,5.100006104 C5.699996948,5.100006104,6,2.379302979,6,-1.149993896 C6,-3.718399048,4.643005371-6,2.100006104-6" /> </group> </vector>

AnimatedVectorDrawable

AVD

VD

ObjectAnimatorObjectAnimator

Nested ScrollingDelegate to scrollable parent containers when appropriate

ViewParent

onStartNestedScroll()

onNestedScroll()/onNestedPreScroll()

onNestedFling() / onNestedPreFling()

Render Thread

UI Thread: Create DisplayList

Render Thread: Process DisplayList … and animations

Support Lib

CardView

RecyclerView

Palette

RoundedBitmapDrawable

ViewPropertyAnimatorCompat

NotificationCompat

WebView updates

Chromium M37 security, stability, bug fixes

New support for open standards WebAudio WebGL WebRTC

Updates from Play Store

System UI

Document- Centric AppsTo create a new document: Intent.FLAG_ACTIVITY_NEW_DOCUMENT <activity documentLaunchMode=”always”>

Manage tasks via ActivityManager.getAppTasks()

Material theme background: card-shaped, shadow-casting foreground: dark text and actions all icons now treated as silhouettes

Accent color Notification.Builder.setColor()

Everything else you know and love Expanded views, action buttons, custom views

Small icon badging2014: Notifications in L

Heads-up notifications

Heads-up notifications

Reserved for things the user needs to deal with High priority Involving people Makes noise fullScreenIntent

Designed to be easy to act on and easy to ignore!

CLICK!

PUBLIC (anyone can read)

AUTHENTICATION (the lockscreen)

SECRET (only you know it’s there)

PRIVATE (only you can read)

VISIBILITY_PUBLIC • notifications that are safe

to show outside the lockscreen, out in public, to anyone

VISIBILITY_PRIVATE (classic Android notifications) • only icons visible without

authentication

VISIBILITY_SECRET • invisible until you unlock

SPHERES OF VISIBILITY

publicVersion

Media & Graphics

OpenGL

OpenGL ES 3.1 NDK and SDK bindings Backward-compatible with OpenGL ES 2.0 and 3.0 Compute shaders & separate shaders Shading language improvements Manifest <uses-feature android:glEsVersion=“0x00030001”/>

Android Extension Pack Superset of OpenGL ES 3.1 Tessellation, geometry shaders, shader storage buffers, images, and atomics, etc.

Camera and Audio

New android.hardware.camera2 APIs Fine-grained capture and image processing RAW capture (DNG) Programmatically access available devices

New audio buffering and encoding capabilities Lower-latency audio input

Other Media EnhancementsMediaSession Respond to transport controls

MediaBrowser Browse media content exposed by apps

MediaProjection Screen and audio capture

PdfRenderer Render PDF as a bitmap

System

ART

Replaces Dalvik Available in KitKat Now enabled by default

Faster! Better! Newer! Cooler! Ahead-of-Time Compilation Smaller GC pauses Dedicated space for large objects (bitmaps) Moving collector (background apps)

Android Runtime

Power: Project Volta

Battery stats $ adb shell dumpsys batterystats Global and per-UID statistics options: --help

Battery Historian (github.com/google/battery-historian) like systrace for power events

Measuring your app’s battery efficiency

Power: Battery Historian

# turn on full wakelock reporting $ adb shell dumpsys batterystats --enable full-history

# clear out old stats $ adb shell dumpsys batterystats --reset

# now run your app, collect data $ adb bugreport > bugreport.txt

# visualize! $ historian.py bugreport.txt > out.html

Example

Power: JobScheduler

You want to do some work when: data is cheap/fast device is plugged in or idle

Possible to do this manually

… but now there’s JobScheduler!

intelligent background processing

Power: JobScheduler

JobInfo uploadTask = new JobInfo.Builder(jobId, componentName) .setRequiredNetworkType(JobInfo.NETWORK_TYPE_UNMETERED) .setRequiresCharging(true) .setRequiresDeviceIdle(true) .build();JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);jobScheduler.schedule(uploadTask);

example

Storage: DocumentTrees

If you’re using the new Storage Access Framework (API 19)

You can now ask for a whole directory! @see Intent.ACTION_OPEN_DOCUMENT_TREE

Then explore the directory and its contents @see DocumentsContract.buildChildDocumentsUriUsingTree(), .buildDocumentUriUsingTree()

New tools for working with directories

Storage: getExternalMediaDirs

• Context.getExternalMediaDirs() · File[] array of package-specific places for media

• like Context.getExternalFilesDirs() · plus automatic MediaStore support

A clean, well-lighted place for media

Multi-Networking

When you need a particular kind of network connection SMS unmetered specific carrier feature

ConnectivityManager.requestNetwork(NetworkRequest, NetworkCallback)

Bluetooth LE

Android 4.3: Bluetooth Low Energy (BLE)

New in Lollipop: BLE peripheral device support Your app can can provide services and scan for services

android.bluetooth.le " BluetoothLeScanner " BluetoothLeAdvertiser

Enterprise & Education

Managed profile (Data segregation)

Profile vs. Device owner

DevicePolicyManager

Screen Pinning

The Lollipop Developer SDK

Download the SDK on d.android.com

And get developing!