82
What’s new in Android

Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Embed Size (px)

Citation preview

Page 1: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

What’s new in Android

Page 2: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Mateusz Herych

Android @ IG

Page 3: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Mateusz Herych

Android @ IG

Fresh dad of twins

Page 4: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Mateusz Herych

Android @ IG

Fresh dad of twins

Full time

Page 5: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Mateusz Herych

Android @ IG

Fresh dad of twins

Full time

4x fulltime

Page 6: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Mateusz Herych

Android @ IG

Fresh dad of twins

Android GDE program member

Page 7: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Mateusz Herych

Android @ IG

Fresh dad of twins

Android GDE program member

GDG Kraków co-org

Page 8: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

What’s new in Android

Page 9: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Android N developer preview

Page 10: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Android N developer preview

Page 11: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

N is for ...

Page 12: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016
Page 13: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016
Page 14: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016
Page 15: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

What cool features is N coming with?

Page 16: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

What cool features is N coming with?

How Android N will break my app?

Page 17: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Why should I care (now)?

Page 18: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Lollipop is over 40% now

Page 19: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Nexus is not just a developer-candy anymore

Page 20: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Multi window support

Page 21: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Multi window support

Was there in 6.0 (Marshmallow) preview, then removed before release.

Page 22: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016
Page 23: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016
Page 24: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016
Page 25: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016
Page 26: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Enabled for every app by default (even for non-N-targetting)

Page 27: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Enabled for every app by default (even for non-N-targetting)

Lifecycle - only most recent Activity is in resumed state.

Page 28: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Enabled for every app by default (even for non-N-targetting)

Lifecycle - only most recent Activity is in resumed state.

Lifecycle - split and resize works same as orientation / configuration change

Page 29: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Enabled for every app by default (even for non-N-targetting)

Lifecycle - only most recent Activity is in resumed state.

Lifecycle - split and resize works same as orientation / configuration change

You can specify a minimum height / width

Page 30: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Two screens at most

Page 31: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Two screens at most

One above another or side-by-side

Page 32: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Two screens at most

One above another or side-by-side

Drag’n’drop between two screens

Page 34: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

How can I know it’ll work?

Page 35: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

How can I know it’ll work?

Install N on your phone / run emulator.

Page 36: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

How can I know it’ll work?

Install N on your phone / run emulator.

“Don’t keep activities” in settings

Page 37: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

How can I know it’ll work?

Install N on your phone / run emulator.

“Don’t keep activities” in settings

Orientation changes

Page 38: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

How can I know it’ll work?

Install N on your phone / run emulator.

“Don’t keep activities” in settings

Orientation changes

Consider your onPause()

Page 39: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Btw

screenOrientation=”portrait”, anyone?

Page 40: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Btw

Isn’t going to work in N.

Page 41: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Btw

Isn’t going to work in N. (unless you disable multi-window support for your app)

Page 42: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Btw

Same case if your app is hiding a status bar.

Page 43: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Yes, you can disable it entirely for your app.

Page 44: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

android:resizeableActivity=["true" | "false"]

Page 45: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

But, please.

Page 46: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Don’t.

Page 47: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Another cool feature that makes Android better.

Page 48: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Future?

Page 49: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016
Page 50: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Maybe.

Page 51: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Doze - Marshmallow

Page 52: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Doze - Marshmallow

Screen is off

Page 53: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Doze - Marshmallow

Screen is off

Not charging

Page 54: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Doze - Marshmallow

Screen is off

Not charging

Device is stationary

Page 55: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Doze - N

Screen is off

Not charging

Device is stationary

Page 56: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Doze - N

Screen is off

Not charging

Device is stationary

Page 57: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Broadcast Receivers

Page 58: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Broadcast Receivers

How much time does it take to shoot a picture on your Android device?

Page 59: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Broadcast Receivers

How much time does it take to shoot a picture on your Android device?

How your devices behaves (performance) when your device connects to a WIFI network?

Page 60: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Broadcast Receivers

CONNECTIVITY_ACTION

ACTION_NEW_PICTURE

ACTION_NEW_VIDEO

Page 61: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Broadcast Receivers

AndroidManifest.xml won’t work for them

Page 62: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Broadcast Receivers

AndroidManifest.xml won’t work for them

Only for foreground apps, with Receivers registered on a main thread

Page 63: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Broadcast Receivers

Even for targetSdk < N

Page 64: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Broadcast Receivers

Don’t listen on CONNECTIVITY_ACTION

Page 65: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Broadcast Receivers

JobScheduler / GCMNetworkManager

Page 66: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Metered plans

Page 67: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Metered plans

How much would you pay for 1 GB of data plan in a foreign country?

Page 68: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Metered plans

1 GB = ?

Page 69: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Metered plans

1 GB = ~2500 EUR

Page 70: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016
Page 71: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Data saver

Page 72: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Data saver

ConnectivityManager.isActiveNetworkMetered()

Page 73: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Data saver

ConnectivityManager.isActiveNetworkMetered()

(API Level 16)

Page 74: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Data saver

Settings -> “Restrict data consumption in the background”

Page 75: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Data saver

Your app can be now whitelisted. Yeah!

Page 76: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Data saver

ConnectivityManager.getRestrictBackgroundStatus()

Page 77: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Data saver

RESTRICT_BACKGROUND_STATUS_DISABLED

RESTRICT_BACKGROUND_STATUS_ENABLED

RESTRICT_BACKGROUND_STATUS_WHITELISTED

Page 78: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

There are more

Page 79: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

There are moreJava 8 support (finally, but!)

Page 80: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

There are moreJava 8 support (finally, but!)

New notifications (built-in new support lib, Notification.Builder)

Page 81: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Questions?

Page 82: Migrate your app to Android N - what will work OOTB, and what will suddenly break your app. UA Mobile 2016

Curry onand #minSdkLevel19