Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

687 views

Published on

Xamarin is a free & powerful toolset from Microsoft that allows developers to write truly *native* Android and iOS apps using C#, thanks to the Mono framework – an Open Source project that brings the C# language and .NET to other platforms. With Xamarin you can share from 70% to 100% of your code across mobile platforms, and the platform has evolved a lot over the last few years. This session starts with a recap on how you can build native cross-platform applications for iOS, Android, and Windows 10 using C#. You’ll learn how to get started with a sample cross-platform solution, which tools you can use, how to design a proper user interface for each platform and how to structure your projects for maximum code reuse. We’ll also look at how you can share UI code with Xamarin.Forms.

Beyond the basics, we’ll look at the world of Cross-Platform .NET, how Xamarin & Mono fit in, .NET Core and the new .NET Standard. We’ll also peek at some of the new features in the Xamarin Platform, including the Xamarin.Forms XAML Previewer, iOS Simulator for Windows, Workbooks and upcoming features landing this Fall. Whether you’re a Xamarin veteran or a complete newbie, this is a level-setting session you do not want to miss.

Published in: Technology

State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

  1. 1. Nick Landry Senior Technical Evangelist – Microsoft nick.landry@microsoft.com Blog: AgeofMobility.com @ActiveNick | github.com/ActiveNick State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
  2. 2.        Agenda
  3. 3. Silo Approach iOS WindowsAndroid Objective-C Xcode C# Visual Studio Java Android Studio No shared code • Many languages & development environments • Multiple teams
  4. 4. Write Once, Run Anywhere App Generator Lua Javascript Actionscript HTML+CSS Limited native API access • Slow performance • Poor user experience
  5. 5. Xamarin’s Unique Approach Shared C# codebase • 100% native API access • High performance iOS C# UI Windows C# UIAndroid C# UI Shared C# Logic
  6. 6. C# and Xamarin’s unique approach The best of all worlds
  7. 7.          2016: A Great Year for Xamarin Developers!
  8. 8. Xamarin is included in Visual Studio
  9. 9. How Xamarin Works
  10. 10. Windows APIs Microsoft.Phone Microsoft.Networking Windows.Storage Windows.Foundation Microsoft.Devices System.Data System.Windows System.Numerics System.Core System.ServiceModel System.Net System System.IO System.Linq System.Xml
  11. 11. iOS – 100% API Coverage MapKit UIKit iBeacon CoreGraphics CoreMotion System.Data System.Windows System.Numerics System.Core System.ServiceModel System.Net System System.IO System.Linq System.Xml
  12. 12. Android – 100% API Coverage Text-to-speech ActionBar Printing Framework Renderscript NFC System.Data System.Windows System.Numerics System.Core System.ServiceModel System.Net System System.IO System.Linq System.Xml
  13. 13. All 3 characteristics are required for a truly native app Xamarin is native in all 3 ways Native User Interface Apps are built with standard, native user interface controls for easy and familiar interactions Apps have access to the full spectrum of functionality exposed by the underlying platform and device Apps leverage platform-specific hardware acceleration, and are compiled as native binaries, not interpreted at runtime. High-fidelity API Access Native Performance
  14. 14. Native Performance Xamarin.iOS does full Ahead Of Time (AOT) compilation to produce an ARM binary for Apple’s App Store. Xamarin.Android takes advantage of Just In Time (JIT) compilation on the Android device.
  15. 15. Same-day support: • iOS 5 • iOS 6 • iOS 7 • iOS 8 • iOS 9 ✓Always Up-to-Date Full support for: • Apple Watch • Apple TV • Android Wear • Amazon Fire TV • and much more
  16. 16. Visual Studio
  17. 17. Xamarin.com/Download Visual Studio Integration
  18. 18. New Light & Dark Themes in Xamarin Studio
  19. 19.          Xamarin Studio - Sharable Components
  20. 20. Demo: Tour of the Xamarin Developer Experience
  21. 21. Xamarin exposes 100% of the native APIs for iOS, Android and Windows
  22. 22. Anything you can do in Objective-C, Swift, or Java can be done in C# with Xamarin using Visual Studio
  23. 23. Cross-Platform .NET: How did we get here? How can we make it better?
  24. 24. Browser Phone
  25. 25. Meet Xamarin.Forms
  26. 26. Xamarin + Xamarin.Forms With Xamarin.Forms: more code-sharing, native controls “Classic” Xamarin approach Shared UI Code
  27. 27. <?xml version="1.0" encoding="UTF-8"?> <TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MyApp.MainPage"> <TabbedPage.Children> <ContentPage Title="Profile" Icon="Profile.png"> <StackLayout Spacing="20" Padding="20" VerticalOptions="Center"> <Entry Placeholder="Username" Text="{Binding Username}"/> <Entry Placeholder="Password" Text="{Binding Password}" IsPassword="true"/> <Button Text="Login" TextColor="White" BackgroundColor="#77D065" Command="{Binding LoginCommand}"/> </StackLayout> </ContentPage> <ContentPage Title="Settings" Icon="Settings.png"> <!-- Settings --> </ContentPage> </TabbedPage.Children> Native UI from shared code
  28. 28. Xamarin.Forms: Build Native User Interfaces Using Shared Code Shared App Logic in C# Xamarin.Forms comes with over 40 common controls, pages and layouts to make app UI creation fast and easy Even basic animations are supported Xamarin.Forms is Fully Extensible: • Subclass included controls and customize behavior • Define and add your own controls, layouts, pages and cells • Expose your own platform-specific controls in Xamarin.Forms pages
  29. 29. Xamarin.Forms is open source too!
  30. 30. • Multi-Touch Enabled • Pressure Sensitive • Super Fast • Rotate, screenshots, location changes • Never leave Visual Studio NEW! Visual Studio iOS Simulator Remoting
  31. 31. Xamarin.Forms XAML Previewer
  32. 32. Demo: Sharing UI Code with Xamarin.Forms
  33. 33. Use Decide Screen-by-Screen Xamarin.Forms is great for forms-based screens. You can mix Xamarin.Forms with the full power of Xamarin.iOS and Xamarin.Android in the same app for complete control over your app’s look and feel. Xamarin.Forms: Mix-and-Match Screen-by-Screen, Element-by-Element Call Platform APIs via Shared Services Need platform-specifc functionality within a Xamarin.Forms page, such as querying the accelerometer? We’ve included services that quickly and easily abstract platform-specific API calls to keep you writing as much shared code as possible. Embed Custom Views Anywhere Not only are Xamarin.Forms pages mixable with custom screens, you can embed custom views built directly against Xamarin.iOS and Xamarin.Android into Xamarin.Forms pages.
  34. 34. • • • • • Roadmap
  35. 35. XAML Compilation Parsed and inflated Parsed & turned into IL
  36. 36. • XAML Compilation Usage [XamlCompilation(XamlCompilationOptions.Compile)] [XamlCompilation(XamlCompilationOptions.Skip)] [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
  37. 37. • • • XAML Compilation Benefits
  38. 38. Xamarin.Forms Ecosystem
  39. 39.   https://evolve.xamarin.com/session/56e205b0bad314273ca4d817    https://medium.com/@harrycheung/mobile-app-performance-redux- e512be94f976#.glqa5cmx6 Xamarin.Forms Performance
  40. 40. Sharing Code
  41. 41. Shared Projects
  42. 42. 1 Assembly Multiple Platforms Including: Xamarin.iOS and Xamarin.Android Portable Class Libraries
  43. 43. NuGet
  44. 44.           Choosing a Code Sharing Option
  45. 45. Demo: Sharing Code with PCLs
  46. 46. Sharing Code Beyond PCLs and .NET Standard: Lighting-up Platform-Specific Code
  47. 47.             Complementing .NET
  48. 48. Platform Specific Code What if we didn’t have to write this code? What if we could access it from shared code? UI+APIs UI + APIsUI + APIs Battery GPS Lights Notifications Settings Text To Speech Battery GPS Lights Notifications Settings Text To Speech Battery GPS Lights Notifications Settings Text To Speech
  49. 49. Xamarin Components and Plugins https://github.com/xamarin/XamarinComponents https://components.xamarin.com
  50. 50. TextToSpeech Speak(“Hello World”); AVSpeechSynthesizer SpeechSynthesizer
  51. 51. Plugins for Xamarin Common API
  52. 52. Sharing Code Beyond PCLs & .NET Standard
  53. 53. Sharing Code Beyond PCLs & .NET Standard
  54. 54. Demo: Plugins for Xamarin & Windows
  55. 55. More New Stuff
  56. 56. Skia Sharp - 2D Graphics Library
  57. 57. Xamarin Workbooks – Interactive C#
  58. 58. Xamarin Profiler
  59. 59. Xamarin Profiler – Cycle Detection
  60. 60.       Fall Themes
  61. 61. Watch dotNetConf 2016 for more on Xamarin, .NET, .Net Core, ASP.NET, Open Source, the Future, etc. http://www.dotnetconf.net/
  62. 62.         Summary
  63. 63.   github.com/ActiveNick/MyWeather  github.com/ActiveNick/MyWeatherNUI  github.com/jamesmontemagno/MyWeather.Forms  github.com/xamarin/xamarin-forms-samples  github.com/xamarin/mini-hacks  github.com/xamarin   https://github.com/jamesmontemagno   http://motzcod.es Session Demos & Xamarin Videos
  64. 64.     https://aka.ms/xamebook  https://aka.ms/xamebook/epub  https://aka.ms/xamebook/mobi Free Xamarin.Forms eBook
  65. 65.   https://blog.xamarin.com/performing-ocr-for-ios-android-and-windows- with-microsoft-cognitive-services/  https://github.com/pierceboggan/smarter-apps/tree/master/ExpenseIt/   https://blog.xamarin.com/adding-facial-recognition-to-your-mobile-apps/  https://github.com/pierceboggan/smarter- apps/tree/master/talk/employee-directory/   https://github.com/xamarin/mini-hacks/tree/master/microsoft-cognitive- services/solutions Demo: Xamarin + Cognitive Services
  66. 66.   https://github.com/DotNetToscana/See4Me   https://github.com/ActiveNick/BingTranslateDemo Demo: Xamarin + Cognitive Services
  67. 67.   http://xamarin.com/download   http://docs.xamarin.com   http://evolve.Xamarin.com   http://xamarin.com/university   http://blog.xamarin.com   http://motzcod.es   http://weblogs.asp.net/wallym   http://www.gregshackles.com Xamarin Resources
  68. 68. Online Microsoft training delivered by experts to help technologists continually learn Hundreds of courses for developers, IT Pros, students, entrepreneurs and enthusiasts 11 different languages More than 2.1M students registered Build your own Learning Plan All free! Cross-Platform Development with Xamarin & Visual Studio aka.ms/MVAxamarin http://www.microsoftvirtualacademy.com
  69. 69. Thank You! Slides are posted SlideShare. Demos are on GitHub. Slideshare: www.slideshare.net/ActiveNick Blog: www.AgeofMobility.com Twitter: @ActiveNick Mobile Apps: www.bigbaldapps.com LinkedIn: www.linkedin.com/in/activenick GitHub: github.com/ActiveNick Email: nick.landry@microsoft.com

×