Android L and So Much More 
James Montemagno 
Developer Evangelist, Xamarin 
@JamesMontemagno
New in Android 
– Android L Developer Preview 
– Android Wear 
– Android TV
Android L Developer Preview
Android L Major Features 
 ART Runtime 
 Material Design 
 Widgets, Views, and Shadows 
 Animations 
 Notifications 
 Compatibility
Android L Major Features 
ART 
Runtime 
 Ahead-of-Time compilation 
 Improved Garbage Collection 
 Improved Debugging Support
Android L Major Features 
Material 
Design 
Material metaphor Bold, graphic, intentional Motion provides meaning 
google.com/design/spec/material-design/introduction.html
 Brand new style for 
applications. 
• Theme.Material 
• Theme.Material.Light 
• Theme.Material.Light. 
DarkActionBar 
Material Design
 colorPrimary – App 
Branding Color 
 colorPrimaryDark – Status 
bar & contextual bars 
 colorAccent – Theme UI 
Controls (ie. checkbox) 
Material Design – Color Palette
Material Design – Color Palette
 Extract Prominent 
Colors from Image 
 6 Palettes Generated 
Material Design –Palettes 
Generate a color pallet from an image 
https://www.nuget.org/packages/Xamarin.Android.Support.v7.Palette/
Material Design – Drawable Tint 
 Bitmaps as alpha maps 
 android:tint=“@color/blue”
Demo
Android L Major Features 
View and 
Shadows 
 CardView 
 RecyclerView 
 Elevation
CardView 
Wrap any view in a CardView 
https://www.nuget.org/packages Xamarin.Android.Support.v7.CardView/
RecyclerView 
 High speed efficient ListView 
 Includes layout manager for positioning items 
 Default animations for common item operations 
https://www.nuget.org/packages/Xamarin.Android.Support.v7.RecyclerView/
Elevation 
 android:elevation=“2dp” 
 View.SetTranslationZ method 
 Z = elevation + translationZ
Demo
Android L Major Features 
Animations 
 Touch Feedback 
 Reveal 
 Activity Transitions
Animation 
Surface reaction
Animation 
Surface reaction 
Material response
Animation 
Surface reaction 
Material response Radial action
 Default Touch Feedback Animation: 
RippleDrawable 
 Set Background to: 
• ?android:attr/selectableItemBackgro 
und 
• ?android:attr/selectableItemBackgro 
undBorderless 
 Create custom RippleDrawable using 
the ripple element 
Animation – Touch Feedback
Animation – Reveal 
 Easily create 
clipping circles
Animation – Activity Transitions 
 Custom animations for enter and exit transitions 
of activities 
• Enter: How views in the activity enter 
• Exit: How view in activity exit 
• Shared Elements: How views that are shared 
between 2 activities animate
Android L Major Features 
Notifications 
 Lock Screen Notifications 
 Notifications Metadata 
 Unified Notifications
New APIs – Lock Screen Notifications (Android L) 
 Android.App.Notification.Builder.SetVisibility() 
• Private: Shows basic information such as icon, but 
hides full content 
• Public: Show the notification's full content 
• Secret: Show nothing, excluding even the 
notification’s icon
New APIs – Notifications Metadata (Android L) 
 SetCategory(): Tells the system how to handle 
notifications when the device is in Do not Disturb 
 SetPriority(): Set to Max or High to appear in a 
small floating window if the sound also has a vibration 
or sound. 
 AddPerson(): Add a list of people to notification.
Unified Notifications – Standard and Extended
Demo
Android L Major Features 
Compatibility 
& More 
 New APIs 
 Android L Small Features 
 Google Play Services via NuGet
New APIs – Compatibility 
 Material Theme 
• Only available in Android L 
Developer Preview 
o Define theme that inherits from 
older theme (like Holo) in 
res/values/styles.xml 
o Define them with same name that 
inherits from Material in res/values-v21/ 
styles.xml 
o Set theme as your app’s theme in 
manifest file 
 Layouts 
• Do not use any of the new XML attributes from 
Android L Developer Preview, they will not work 
with previous versions of Android. 
• You must provide alternative layouts if you wish 
to use them 
o L Preview Layouts: res/layout-v21/ 
o Alternative Layouts: res/layout/ 
o Do avoid duplication of code, define styles in 
res/values/ 
o Modify the style in res/values-v21/ for new APIs
New APIs – Compatibility 
 UI Widgets 
• Support v7: RecyclerView & CardView 
o Limitations (pre-L Preview): 
o CardView falls back to 
programmatic shadows 
implementation using additional 
padding 
o CardView does not clip its children 
that intersect with rounded corners 
 Animations 
• Following are Android L Developer Preview ONLY: 
o Activity Transitions 
o Touch feedback 
o Reveal animations 
o Path-based animations
Android L Small Features 
 Camera 
• Enhanced image and 
video capturing. Capture 
Raw sensor data. 
 Multi-networking 
• Dynamically scan for 
available network with 
specific capability and 
automatically connect. 
 BLE Peripheral Mode 
• Apps that connect to devices 
such as pedometer or health 
monitor and transfer data to 
another BLE device. 
 Document-Centric Recents 
 Job Scheduler
Google Play Services via NuGet 
 Play Game Services: event –based challenges, saved 
games, and game profiles 
 App Indexing API 
 Google Cast: Media tracks for closed captioning 
 Wallet: Save to Wallet, geo-fenced in-store notifications, 
split tender between wallet & card 
 Analytics: Measure product impressions/product clicks 
 Mobile Ads: in-app purchase ads 
 Dynamic Security Provider
Android Wear
Android Wear – Extending Apps 
 Enhance Existing Apps 
• Support v4 Notification API 
o WearableExtender 
 Inbox Style Cards 
 Voice Input
Android Wear Notifications + Expanded
Android Wear Notifications - Actions
Android Wear – Building Apps 
 Companion App 
• Android app that runs on a wearable 
 New Themes 
 New UI Widgets 
• BoxInsetLayout 
• CircledImageView 
• WearableListView 
• More… 
http://www.nuget.org/packages/Xamarin.Android.Wear/
Android Wear – Sync Data 
 Exposed via Google Play Services 
• Data API 
o Sync datastore between phone and wearable 
 Message API 
o Send small payloads and simple 
o communication 
http://www.nuget.org/packages/Xamarin.GooglePlayServicesJellyBean/
Android Wear – Templates + NuGet 
http://www.nuget.org/packages/Xamarin.Android.Wear/
Demo
Android TV
Android TV Features 
 Made for TV 
• Pre-built fragments for browsing & interacting 
with media catalogs 
 In-App Searching 
• Voice input for searching content 
 Recommendations 
• Suggest content from your app 
 Chromecast Built-in
Android TV ADT-1 Development Kit 
http://developer.android.com/tv/index.html
Android TV + Xamarin 
 Available via NuGet 
• https://www.nuget.org/packages/Xamarin.Android.Support.v17.Leanback 
 Samples: 
• https://github.com/xamarin/monodroid-samples
Android Recap 
• Android L Developer Preview 
• Material Design 
• Views & Animations 
• Notifications 
• Android Wear 
• Notifications & Companion Apps 
• Android TV
Resources 
 Tips for Your First Wear App 
 http://blog.xamarin.com/tips-for-your-first-android-wear-app/ 
 Android L Documentation 
 http://developer.xamarin.com/guides/android/platform_features/android_l/introduc 
tion_to_android_l/ 
 Samples 
 http://developer.xamarin.com/samples/android/
Dive Deep into Mobile Development with the Experts! 
xamarin.com/evolve
Q & A 
James Montemagno 
Developer Evangelist, Xamarin 
@JamesMontemagno

Android L and So Much More Webinar Slides

  • 1.
    Android L andSo Much More James Montemagno Developer Evangelist, Xamarin @JamesMontemagno
  • 2.
    New in Android – Android L Developer Preview – Android Wear – Android TV
  • 3.
  • 4.
    Android L MajorFeatures  ART Runtime  Material Design  Widgets, Views, and Shadows  Animations  Notifications  Compatibility
  • 5.
    Android L MajorFeatures ART Runtime  Ahead-of-Time compilation  Improved Garbage Collection  Improved Debugging Support
  • 6.
    Android L MajorFeatures Material Design Material metaphor Bold, graphic, intentional Motion provides meaning google.com/design/spec/material-design/introduction.html
  • 7.
     Brand newstyle for applications. • Theme.Material • Theme.Material.Light • Theme.Material.Light. DarkActionBar Material Design
  • 8.
     colorPrimary –App Branding Color  colorPrimaryDark – Status bar & contextual bars  colorAccent – Theme UI Controls (ie. checkbox) Material Design – Color Palette
  • 9.
    Material Design –Color Palette
  • 10.
     Extract Prominent Colors from Image  6 Palettes Generated Material Design –Palettes Generate a color pallet from an image https://www.nuget.org/packages/Xamarin.Android.Support.v7.Palette/
  • 11.
    Material Design –Drawable Tint  Bitmaps as alpha maps  android:tint=“@color/blue”
  • 12.
  • 13.
    Android L MajorFeatures View and Shadows  CardView  RecyclerView  Elevation
  • 14.
    CardView Wrap anyview in a CardView https://www.nuget.org/packages Xamarin.Android.Support.v7.CardView/
  • 15.
    RecyclerView  Highspeed efficient ListView  Includes layout manager for positioning items  Default animations for common item operations https://www.nuget.org/packages/Xamarin.Android.Support.v7.RecyclerView/
  • 16.
    Elevation  android:elevation=“2dp”  View.SetTranslationZ method  Z = elevation + translationZ
  • 17.
  • 18.
    Android L MajorFeatures Animations  Touch Feedback  Reveal  Activity Transitions
  • 19.
  • 20.
    Animation Surface reaction Material response
  • 21.
    Animation Surface reaction Material response Radial action
  • 22.
     Default TouchFeedback Animation: RippleDrawable  Set Background to: • ?android:attr/selectableItemBackgro und • ?android:attr/selectableItemBackgro undBorderless  Create custom RippleDrawable using the ripple element Animation – Touch Feedback
  • 23.
    Animation – Reveal  Easily create clipping circles
  • 24.
    Animation – ActivityTransitions  Custom animations for enter and exit transitions of activities • Enter: How views in the activity enter • Exit: How view in activity exit • Shared Elements: How views that are shared between 2 activities animate
  • 25.
    Android L MajorFeatures Notifications  Lock Screen Notifications  Notifications Metadata  Unified Notifications
  • 26.
    New APIs –Lock Screen Notifications (Android L)  Android.App.Notification.Builder.SetVisibility() • Private: Shows basic information such as icon, but hides full content • Public: Show the notification's full content • Secret: Show nothing, excluding even the notification’s icon
  • 27.
    New APIs –Notifications Metadata (Android L)  SetCategory(): Tells the system how to handle notifications when the device is in Do not Disturb  SetPriority(): Set to Max or High to appear in a small floating window if the sound also has a vibration or sound.  AddPerson(): Add a list of people to notification.
  • 28.
    Unified Notifications –Standard and Extended
  • 29.
  • 30.
    Android L MajorFeatures Compatibility & More  New APIs  Android L Small Features  Google Play Services via NuGet
  • 31.
    New APIs –Compatibility  Material Theme • Only available in Android L Developer Preview o Define theme that inherits from older theme (like Holo) in res/values/styles.xml o Define them with same name that inherits from Material in res/values-v21/ styles.xml o Set theme as your app’s theme in manifest file  Layouts • Do not use any of the new XML attributes from Android L Developer Preview, they will not work with previous versions of Android. • You must provide alternative layouts if you wish to use them o L Preview Layouts: res/layout-v21/ o Alternative Layouts: res/layout/ o Do avoid duplication of code, define styles in res/values/ o Modify the style in res/values-v21/ for new APIs
  • 32.
    New APIs –Compatibility  UI Widgets • Support v7: RecyclerView & CardView o Limitations (pre-L Preview): o CardView falls back to programmatic shadows implementation using additional padding o CardView does not clip its children that intersect with rounded corners  Animations • Following are Android L Developer Preview ONLY: o Activity Transitions o Touch feedback o Reveal animations o Path-based animations
  • 33.
    Android L SmallFeatures  Camera • Enhanced image and video capturing. Capture Raw sensor data.  Multi-networking • Dynamically scan for available network with specific capability and automatically connect.  BLE Peripheral Mode • Apps that connect to devices such as pedometer or health monitor and transfer data to another BLE device.  Document-Centric Recents  Job Scheduler
  • 34.
    Google Play Servicesvia NuGet  Play Game Services: event –based challenges, saved games, and game profiles  App Indexing API  Google Cast: Media tracks for closed captioning  Wallet: Save to Wallet, geo-fenced in-store notifications, split tender between wallet & card  Analytics: Measure product impressions/product clicks  Mobile Ads: in-app purchase ads  Dynamic Security Provider
  • 35.
  • 36.
    Android Wear –Extending Apps  Enhance Existing Apps • Support v4 Notification API o WearableExtender  Inbox Style Cards  Voice Input
  • 37.
  • 38.
  • 39.
    Android Wear –Building Apps  Companion App • Android app that runs on a wearable  New Themes  New UI Widgets • BoxInsetLayout • CircledImageView • WearableListView • More… http://www.nuget.org/packages/Xamarin.Android.Wear/
  • 40.
    Android Wear –Sync Data  Exposed via Google Play Services • Data API o Sync datastore between phone and wearable  Message API o Send small payloads and simple o communication http://www.nuget.org/packages/Xamarin.GooglePlayServicesJellyBean/
  • 41.
    Android Wear –Templates + NuGet http://www.nuget.org/packages/Xamarin.Android.Wear/
  • 42.
  • 43.
  • 44.
    Android TV Features  Made for TV • Pre-built fragments for browsing & interacting with media catalogs  In-App Searching • Voice input for searching content  Recommendations • Suggest content from your app  Chromecast Built-in
  • 45.
    Android TV ADT-1Development Kit http://developer.android.com/tv/index.html
  • 46.
    Android TV +Xamarin  Available via NuGet • https://www.nuget.org/packages/Xamarin.Android.Support.v17.Leanback  Samples: • https://github.com/xamarin/monodroid-samples
  • 47.
    Android Recap •Android L Developer Preview • Material Design • Views & Animations • Notifications • Android Wear • Notifications & Companion Apps • Android TV
  • 48.
    Resources  Tipsfor Your First Wear App  http://blog.xamarin.com/tips-for-your-first-android-wear-app/  Android L Documentation  http://developer.xamarin.com/guides/android/platform_features/android_l/introduc tion_to_android_l/  Samples  http://developer.xamarin.com/samples/android/
  • 49.
    Dive Deep intoMobile Development with the Experts! xamarin.com/evolve
  • 50.
    Q & A James Montemagno Developer Evangelist, Xamarin @JamesMontemagno

Editor's Notes

  • #5 Only available in Android L Developer Preview
  • #6 You might run into issues with ART if you: -Use JNI to run C/C++ code -Generate non-standard code (like obfuscators) -Use compacting garbage collection techniques
  • #7 Only available in Android L Developer Preview
  • #9 Available in Android.Support.v7 library from NuGet
  • #10 Available in Android.Support.v7 library from NuGet
  • #11 Available in Android.Support.v7 library from NuGet
  • #12 Available in Android.Support.v7 library from NuGet
  • #14 Only available in Android L Developer Preview
  • #15 Available in Android.Support.v7 library from NuGet
  • #16 Available in Android.Support.v7 library from NuGet
  • #17 Available in Android.Support.v7 library from NuGet
  • #19 Only available in Android L Developer Preview
  • #23 Available in Android.Support.v7 library from NuGet
  • #24 Available in Android.Support.v7 library from NuGet
  • #25 Available in Android.Support.v7 library from NuGet
  • #26 Only available in Android L Developer Preview
  • #27 Available in Android.Support.v7 library from NuGet
  • #28 Available in Android.Support.v7 library from NuGet
  • #29 Available in Android.Support.v7 library from NuGet
  • #31 Only available in Android L Developer Preview
  • #32 Available in Android.Support.v7 library from NuGet
  • #33 Available in Android.Support.v7 library from NuGet
  • #34 Available in Android.Support.v7 library from NuGet
  • #35 Available in Android.Support.v7 library from NuGet
  • #37 Only available in Android L Developer Preview
  • #38 Only available in Android L Developer Preview
  • #39 Only available in Android L Developer Preview
  • #40 Only available in Android L Developer Preview
  • #41 Only available in Android L Developer Preview
  • #42 Only available in Android L Developer Preview
  • #45 Only available in Android L Developer Preview
  • #46 Only available in Android L Developer Preview
  • #47 Only available in Android L Developer Preview
  • #49 Only available in Android L Developer Preview