android lollipop: the developer's perspective

39
Android 5.0 Lollipop local.ch

Upload: sebastian-vieira

Post on 17-Jul-2015

439 views

Category:

Engineering


2 download

TRANSCRIPT

Page 2: Android Lollipop: The developer's perspective
Page 3: Android Lollipop: The developer's perspective

What’s New?

Page 4: Android Lollipop: The developer's perspective

What's new

● Material Design

● Enhanced Notifications

● Concurrent documents in Overview

o Intent.FLAG_ACTIVITY_NEW_DOCUMENT

o ActivityManager.getAppTasks

Page 5: Android Lollipop: The developer's perspective

What’s new

● Project Volta

● 3.1

o With Android Extension Pack

● Webview (updatable)

o WebAudio

Page 6: Android Lollipop: The developer's perspective

Android Runtime Evolved - ART

● Ahead-of-time (AOT) compilation

● Improved garbage collection (GC)

o Less latency (2ms average)

● Separate heap for big assets (bitmaps)

● 64 bit

Page 7: Android Lollipop: The developer's perspective

Dalvik vs Art

Dalvik ART

Uses Just-In-Time (JIT) approach, which

results in lower storage space consumption

but longer app load times

Uses Ahead-Of-Time (AOT) approach,

which compiles apps when they’re

installed, resulting in faster load times

and lower processor usage

Cache builds up over time, so boot times

are faster

Cache is built at first boot, hence

rebooting device takes significantly longer

Works better for lower internal storage

devices as space occupied is lesser

Consumes much more internal storage

space since it stores compiled apps in

addition to the APKs

Page 8: Android Lollipop: The developer's perspective

Tools

● Variants: different versions of the app

(debug vs release or paid vs free)

● APK split combining native with common

code

Page 9: Android Lollipop: The developer's perspective

Google Play Services

Page 10: Android Lollipop: The developer's perspective

Google Play Services

● Android Wear Data API

o Messages API

o Assets API (binary blocks)

o DataItem (sync data among devices)

Page 11: Android Lollipop: The developer's perspective

Google Play Services

● Address API

● OCR scanning of credit cards

● Google Wallet API

o Fragments support

● Google Analytics (with Tag manager)

Page 12: Android Lollipop: The developer's perspective

Google Play Services

● Activity recognition:Walking, running

● Google Cast SDK

● Play Games

Page 13: Android Lollipop: The developer's perspective

Google Play Services

● Security API

● Google Fit

● Drive API

Page 14: Android Lollipop: The developer's perspective

Workplace

● Managed provision and unified view of apps

o Device Owner (device administrator)

● Screen pinning (lock app in the foreground)

● Screen sharing and capture

● Render PDFs as Bitmaps

Page 15: Android Lollipop: The developer's perspective

Media

● Advanced camera capabilities

o RAW support!

● Audio devices: Low Latency audio input

● Media Browser and Media Session API

o Flexible playback control

Page 16: Android Lollipop: The developer's perspective

Connectivity

● BLE Peripheral Device support

o Providing services and scan for services

● Multi Networking

o When you need a particular kind of network

o ConnectivityManager.requestNetwork

o Graceful handoff to another network

Page 17: Android Lollipop: The developer's perspective

● … and a few new platforms

1. Android Wear

2. Android TV

3. Android Auto

Page 18: Android Lollipop: The developer's perspective

Activity and Fragment Transitions

● Activity Transitions

o ActivityOptions.makeSceneTransitionAnimation

o With declared shared elements to make the

transitions smoother

o With the possibilities for enter and exit elements

o All this thanks to the new Render Thread

Page 19: Android Lollipop: The developer's perspective

View Transitions

● Reveal

o Reveal content with a circular expanding mask

Animator reveal = ViewAnimationUtils.createCircularReveal(

viewToReveal, // The new View to reveal

centerX, // x co-ordinate to start the mask from

centerY, // y co-ordinate to start the mask from

startRadius, // radius of the starting mask

endRadius); // radius of the final mask

Page 21: Android Lollipop: The developer's perspective

Curved Motion

● Animation Curves

o New Interpolators

fast-in-slow-out

linear-out-slow-in (enter screen)

fast-out-linear-in (exit screen)

o ObjectAnimator

Page 22: Android Lollipop: The developer's perspective

Iconography

● State Animators

o StateListAnimator and AnimatedStateListDrawable

ie. state of a view changes (checkbox)

o AnimatedVectorDrawable

● Touch feedback ripples

o By default on buttons, very simple otherwise

Page 24: Android Lollipop: The developer's perspective
Page 25: Android Lollipop: The developer's perspective

Colors

● colorPrimary (brand)

● colorAccent (controls)

● colorPrimaryDark (status bar)

● Palette API

○ Material Color Palettes

○ Swatches

Page 26: Android Lollipop: The developer's perspective

Recycler Views

Generalization of the ListView (aka ListView2)

Page 27: Android Lollipop: The developer's perspective

CardView

<android.support.v7.widget.CardView

android:layout_width="match_parent"

android:layout_height="wrap_content">

<!-- Your card content -->

</android.support.v7.widget.CardView>

Page 28: Android Lollipop: The developer's perspective

Toolbar

● Generalization of the ActionBar

o It can be placed anywhere

● … and it offers support for Custom Views

Page 29: Android Lollipop: The developer's perspective

Support Library v7

● Theme.AppCompat

● RecyclerView

● CardView

● Toolbar

● Palette API

Page 30: Android Lollipop: The developer's perspective

Project Volta

● Improve your battery life!

● JobScheduler API

o Start when charging / wifi / unmetered network/

idle / deadline or minimum delay

● Battery Historian

o adb shell dumpsys batterystats

Page 31: Android Lollipop: The developer's perspective
Page 32: Android Lollipop: The developer's perspective

Notifications

● Adapted for Material Design

● Accent Color fills a circle in icon

● Small icon badging

● … expanded views and custom remote views

● MediaStyle Template for media playback

Page 33: Android Lollipop: The developer's perspective

Notifications

● Heads-up notifications

o Floating alerts that can be swiped away

● Lock Screen notifications

o PUBLIC, PRIVATE and SECRET notifications

NotificationVisibility

Page 34: Android Lollipop: The developer's perspective

Notifications metadata

● ...anotate them to prioritize them

● Notification categorizations

o call, message, alarm, social

o EXTRA_PEOPLE (uri or email…)

o when: fullscreenintent, prority,= vibrate/sound

Page 35: Android Lollipop: The developer's perspective

notifications and wear

● What you get on your phone, on your watch

● Or extend: Notification.WearableExtender

Page 36: Android Lollipop: The developer's perspective

Android TV

● Leanback UI

o LEANBACK_LAUNCHER

● @style/Theme.Leanback

Page 37: Android Lollipop: The developer's perspective

Android Auto

● Audio apps

● Messaging apps

Page 38: Android Lollipop: The developer's perspective

Resources

http://android-developers.blogspot.ch/2014/10/implementing-material-design-in-your.html

http://trickyandroid.com/simple-ripple-reveal-elevation-tutorial/

http://developer.android.com/about/versions/android-5.0.html

http://developer.android.com/about/versions/lollipop.html

Page 39: Android Lollipop: The developer's perspective

Thanks!

@seviu

[email protected]

ch.linkedin.com/in/seviu

● Presentation available:o http://goo.gl/hudvPx