Slide 1

Slide 1 text

You should be looking at

Slide 2

Slide 2 text

Hi! I’m Jérémie @jeremie_laval

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Android IDE tooling Android Component s Evangelis m A monkey?!

Slide 5

Slide 5 text

Android Fanboy Android Fanboy Android Fanboy Banana!

Slide 6

Slide 6 text

what’s new in Android M

Slide 7

Slide 7 text

Android M Preview codename MNC Macadamia Nut Cookie (Marzipan?) (M&Ms?)

Slide 8

Slide 8 text

Preview Availability

Slide 9

Slide 9 text

Timeline A preview release ~every month Preview 1 Google I/O 2015 Preview 2 July 16th Preview 3 August? Final release Late September

Slide 10

Slide 10 text

Release Focus Polish Performance Battery savings 7

Slide 11

Slide 11 text

Platform Highlights New Permission Workflow Doze / App Standby Material Design Updates

Slide 12

Slide 12 text

App Permissions

Slide 13

Slide 13 text

Old Style

Slide 14

Slide 14 text

Issues Prevent automatic updates Out-of-context Low user-engagement

Slide 15

Slide 15 text

Advantage Total Developer Freedom

Slide 16

Slide 16 text

The New System Low and high risk permission split → Only if your app targets M Contextualized asking for more Cope with refusal/revocation

Slide 17

Slide 17 text

What you get Bluetooth Internet Network State NFC Vibrate Settings Flashlight Accounts Alarm … As declared in app manifest

Slide 18

Slide 18 text

Asking for a cookie if (CheckSelfPermission (this, Manifest.Permission.Camera) != Permission.Granted) {
 if (ShouldShowRequestPermissionRationale (Manifest.Permission.Camera))
 Toast.MakeText (/* ... */);
 RequestPermissions (new string[] { Manifest.Permission.Camera }, RequestCamera);
 } public override void OnRequestPermissionsResult (int requestCode,
 string[] permissions,
 int[] grantResults)
 {
 if (requestCode == RequestCamera) {
 // Handle permission response
 }
 }

Slide 19

Slide 19 text

In-app permission

Slide 20

Slide 20 text

Revoke permissions

Slide 21

Slide 21 text

What about “necessary” permissions?

Slide 22

Slide 22 text

Cold start permissions

Slide 23

Slide 23 text

The Battery Savers

Slide 24

Slide 24 text

Doze Smart detect device inactivity and force shut everything Network is disabled Wake locks are ignored AlarmManager, Sync, JobScheduler prevented

Slide 25

Slide 25 text

App Standby Automatically jail inactive applications Network is disabled Wakeups are regulated → Unless charging or app deemed used

Slide 26

Slide 26 text

Material Updates

Slide 27

Slide 27 text

Spec Updates 1 year of Material design google.com/design

Slide 28

Slide 28 text

New Resources Icon Library Device Metrics Tool

Slide 29

Slide 29 text

Support Design Library Default implementation of Material Support Library Design Companion to support-v7-appcompat

Slide 30

Slide 30 text

What’s in the box And more… NavigationView Snackbar Floating Action Button

Slide 31

Slide 31 text

NavigationView 
 
 


Slide 32

Slide 32 text

NavigationView 
 
 
 
 
 


Slide 33

Slide 33 text

SnackBar Snackbar.Make (view, "Here's a snackbar!", Snackbar.LengthLong)
 .SetAction ("Action", v => {})
 .Show ();

Slide 34

Slide 34 text

Floating Action Button

Slide 35

Slide 35 text

CoordinatorLayout Anchor floating items Choreograph view movements Implement interaction patterns

Slide 36

Slide 36 text

CoordinatorLayout 
 
 
 


Slide 37

Slide 37 text

Behaviors CoordinatorLayout.Behavior LayoutDependsOn / OnDependentViewChanged OnLayoutChild/OnMeasureChild OnInterceptTouchEvent/OnTouchEvent OnNested*Scroll/OnNested*Fling

Slide 38

Slide 38 text

Custom behavior public class InfoPaneFabBehavior : CoordinatorLayout.Behavior
 {
 // …
 
 public override bool LayoutDependsOn (CoordinatorLayout parent, Java.Lang.Object child, View dependency)
 {
 return dependency is InfoPane;
 }
 
 public override bool OnDependentViewChanged (CoordinatorLayout parent, Java.Lang.Object child, View dependency)
 {
 // Move the fab vertically to place correctly wrt the info pane
 var fab = child.JavaCast ();
 var currentInfoPaneY = ViewCompat.GetTranslationY (dependency);
 var newTransY = (int)Math.Max (0, dependency.Height - currentInfoPaneY - minMarginBottom - fab.Height / 2);
 ViewCompat.SetTranslationY (fab, -newTransY);
 
 // If alternating between open/closed state, change the FAB face
 if (wasOpened ^ ((InfoPane)dependency).Opened) {
 fab.Switch ();
 wasOpened = !wasOpened;
 }
 
 return true;
 }
 }

Slide 39

Slide 39 text

Custom behavior

Slide 40

Slide 40 text

M Checklist Think about your permission workflow Be careful that Doze won’t break your app Consider porting your app to appcompat

Slide 41

Slide 41 text

Links Google I/O 2015 talks Permissions youtu.be/f17qe9vZ8RM Material Now youtu.be/8UicJ0SxBwA Samples github.com/xamarin/monodroid-samples/tree/master/android-m github.com/xamarin/monodroid-samples/tree/master/android5.0/Cheesesquare Blogs android-developers.blogspot.com/2015/05/android-design-support-library.html blog.xamarin.com/add-beautiful-material-design-with-the-android-support-design-library/