Building Mobile Cross-Platform Apps for iOS, Android & Windows in C# with Xamarin

  • Published on
    07-Jan-2017

  • View
    7.632

  • Download
    3

Transcript

<ul><li><p>Building Mobile Cross-Platform Apps foriOS, Android &amp; Windows in C# with Xamarin</p><p>Nick LandrySenior Technical Evangelist, MicrosoftAgeofMobility.com@ActiveNick github.com/activenick</p></li><li><p>Session Agenda</p></li><li><p>Audience poll</p></li><li><p>Silo Approach:</p><p>Build the Same Apps Multiple Times</p></li><li><p>The Siloed approach: Build native apps multiple timesMultiple teams and multiple code bases are expensive and slow</p><p>+</p><p>+</p><p>-</p></li><li><p>Write Once,Run AnywhereApproach</p><p>Lowest Common Denominator</p><p>Browser Fragmentation</p><p> App Generation.</p><p> Web Browser in a </p><p>Native Wrapper + </p><p>Platform APIs.</p></li><li><p>The write-once-run-anywhere approachHTML Hybrid scenarios (Semi-native apps) like Cordova (i.e. PhoneGap)</p></li><li><p>Xamarins Unique Approach</p><p>Shared C# codebase 100% native API access High performance</p><p>iOS C# UI Windows C# UIAndroid C# UI</p><p>Shared C# Mobile C# Server</p><p>Linux/Mono</p><p>CoreCLRAzure</p><p>Shared C# Client/Server</p></li><li><p>C# and Xamarins unique approachThe best of all worlds</p></li><li><p>How Does Xamarin Run C# on iOS or Android?</p></li><li><p>Windows APIs</p><p>Microsoft.Phone Microsoft.Networking Windows.Storage Windows.Foundation Microsoft.Devices</p><p>System.Data System.Windows System.Numerics System.Core System.ServiceModel</p><p>System.Net System System.IO System.Linq System.Xml</p><p>C#</p></li><li><p>iOS 100% API Coverage</p><p>MapKit UIKit iBeacon CoreGraphics CoreMotion</p><p>System.Data System.Windows System.Numerics System.Core System.ServiceModel</p><p>System.Net System System.IO System.Linq System.Xml</p><p>C#</p></li><li><p>Android 100% API Coverage</p><p>Text-to-speech ActionBar Printing Framework Renderscript NFC</p><p>System.Data System.Windows System.Numerics System.Core System.ServiceModel</p><p>System.Net System System.IO System.Linq System.Xml</p><p>C#</p></li><li><p>All 3 characteristics are required for a truly native app</p><p>Xamarin is native in all 3 ways</p><p>Native User Interface</p><p>Apps are built with standard, native </p><p>user interface controls for easy and </p><p>familiar interactions</p><p>Apps have access to the full spectrum of </p><p>functionality exposed by the underlying </p><p>platform and device</p><p>Apps leverage platform-specific hardware </p><p>acceleration, and are compiled as native </p><p>binaries, not interpreted at runtime.</p><p>High-fidelity API Access</p><p>Native Performance</p></li><li><p>Xamarin exposes 100% of the native APIs </p><p>for iOS, Android and Windows</p></li><li><p>Anything you can do in Objective-C or Java </p><p>can be done in C# with Xamarin using Visual Studio</p></li><li><p>Native Performance</p><p> Xamarin.iOS does full Ahead Of </p><p>Time (AOT) compilation to </p><p>produce an ARM binary for </p><p>Apples App Store.</p><p> Xamarin.Android takes advantage of </p><p>Just In Time (JIT) compilation on the </p><p>Android device.</p></li><li><p>Always Up-to-Date</p><p>Full support for:Google Glass, Android Wear, Amazon Fire TV</p></li><li><p>Xamarin: How much?</p><p>Yes!</p></li><li><p>Development Environment</p><p>Xamarin Studio</p><p>PC or Mac</p><p>Visual Studio Plugin</p><p>VS 2010/2012/2013/2015</p></li><li><p>Xamarin Studio</p></li><li><p>Xamarin + Xamarin.FormsWith Xamarin.Forms: </p><p>more code-sharing, native controlsTraditional/Classic Xamarin approach</p><p>Shared UI Code</p></li><li><p>Whats included</p><p> 40+ Pages, layouts, and controls</p><p>(Build from code behind or XAML)</p><p> Two-way data binding</p><p> Navigation</p><p> Animation API</p><p> Dependency Service</p><p> Messaging Center</p><p>Shared C# App Backend</p><p>(non-UI code)</p><p>Shared UI Code</p></li><li><p>Native UI from shared code</p><p>At runtime, each Xamarin.Forms page and its </p><p>controls are mapped to platform-specific native </p><p>user interface elements </p><p>Use a single API to generate native, platform-specific user interfaces</p></li><li><p>Xamarin.Forms Pages</p><p>Content MasterDetail Navigation Tabbed Carousel</p><p>UIViewController Activity Page</p></li><li><p>Xamarin.Forms Layouts</p><p>Stack Absolute Relative Grid ContentView ScrollView Frame</p></li><li><p>40+ Xamarin.Forms Controls</p><p>ActivityIndicator BoxView Button DatePicker Editor</p><p>Entry Image Label ListView Map</p><p>OpenGLView Picker ProgressBar SearchBar Slider</p><p>Stepper TableView TimePicker WebView EntryCell</p><p>ImageCell SwitchCell TextCell ViewCell</p></li><li><p>Shared Projects</p></li><li><p>NuGet</p></li><li><p>Portable Class Libraries</p></li><li><p>Choosing a Code Sharing Option</p></li><li><p>Native Dev: Platform Tools or Xamarin?</p><p>Platform Tools (Windows, iOS, Android)</p><p> Default native method to build apps</p><p> Free development tools &amp; SDKs</p><p> Requires learning at least one language &amp; </p><p>SDK per platform (C#, Java, Objective-C)</p><p> Design, develop &amp; maintain completely </p><p>separate apps for each platform</p><p> More learning resources available</p><p> Books, web sites, blogs, training, </p><p>StackOverflow, videos, larger </p><p>community, etc.</p><p> Yet, iOS developers are (kinda) starting all </p><p>over with Swift</p><p>Xamarin / Mono</p><p> Reuse existing C# skills &amp; source code (but </p><p>you have to know C#)</p><p> Need to buy an additional tool: extra cost</p><p> Need to learn new tools &amp; techniques</p><p> Still need to learn the specifics of each </p><p>platform SDK, app architecture &amp; lifecycle</p><p> Fewer third-party libraries available</p><p> Built-in GUI designer for iOS and Android</p><p> Xamarin.Forms provides native shared Uis, </p><p>but there is no XAML designer (yet)</p><p> Vendor lock-in / dependency</p></li><li><p>Mobile Strategy Considerations</p><p>Audience</p><p> General Consumer </p><p>Market</p><p> Niche Consumer </p><p>Market</p><p> Enterprise Users</p><p> BYOD</p><p>Objectives</p><p> Marketing Checklist </p><p>Apps</p><p> Brand Reach Apps</p><p> Weekend Warrior Apps</p><p> Apps for Profit</p><p> Mobile Revolution </p><p>Apps</p><p>Other Considerations</p><p> Mobile Population </p><p>Coverage Target &amp; </p><p>Desired Reach</p><p> Expertise</p><p> Resources</p><p> Timeframe</p></li><li><p>Summary</p></li><li><p> github.com/ActiveNick/MyWeatherNUI</p><p> github.com/ActiveNick/MyWeather</p><p> github.com/ActiveNick/BingTranslateDemo</p><p> github.com/ActiveNick/HelloWeather</p><p> github.com/ActiveNick/AzureChatrforWindows</p><p> github.com/jamesmontemagno/MyStocks.Forms</p><p> github.com/jamesmontemagno/MyExpenses-Sync</p><p>Session Demos</p></li><li><p>http://channel9.msdn.com/events/Build/2015/3-770</p><p>http://aka.ms/ch9xam2015-1</p><p>http://aka.ms/ch9xam2015-2</p><p>http://aka.ms/ch9xam2015-3</p><p>http://aka.ms/ch9xam2015-4</p><p>http://channel9.msdn.com/Search?term=xamarin#ch9Search&amp;lang-en=en</p><p>Xamarin Videos for Developers</p><p>http://channel9.msdn.com/events/Build/2015/3-770http://aka.ms/ch9xam2015-1http://aka.ms/ch9xam2015-2http://aka.ms/ch9xam2015-3http://aka.ms/ch9xam2015-4http://channel9.msdn.com/Search?term=xamarin#ch9Search&amp;lang-en=en</p></li><li><p> http://xamarin.com/download</p><p> http://docs.xamarin.com</p><p> http://evolve.xamarin.com</p><p> http://xamarin.com/university</p><p> http://blog.xamarin.com</p><p> http://motzcod.es</p><p> http://weblogs.asp.net/wallym</p><p> http://www.gregshackles.com</p><p>Xamarin Resources</p></li><li><p>Xamarin Developer Certifications:Be part of an Elite Developer Community</p><p>Students have the option to take a certification test and become Xamarin certified. Xamarin skills are increasingly in demand certifications let the market know you represent top talent. </p></li><li><p>Online Microsoft training delivered by experts to help technologists continually learn</p><p>Hundreds of courses for developers, IT Pros, students, entrepreneurs and enthusiasts</p><p>11 different languages</p><p>More than 3M students registered</p><p>Build your own Learning Plan</p><p>All free!</p><p>Cross-Platform Development withXamarin &amp; Visual Studio</p><p>aka.ms/MVAxamarin</p><p>http://www.microsoftvirtualacademy.com</p></li><li><p> Universal Windows App Developmentwith Cortana and the Speech SDK</p><p> Available for on-demand viewing now:</p><p>http://aka.ms/CortanaMVA</p></li><li><p>Recommended Xamarin Books</p><p>http://aka.ms/Xs5v48</p><p>Xamarin Mobile Application Development for Android</p><p>(Mark Reynolds)</p><p>http://aka.ms/Ndl0jn</p><p>iOS Development with Xamarin Cookbook</p><p>(Dimitris Tavlikos)</p><p>http://aka.ms/S8akz1</p><p>Xamarin Cross-Platform Application Development</p><p>(Jonathan Peppers) </p><p>http://aka.ms/Sl5aj9</p></li><li><p>Thank You!</p><p>Slides are posted on SlideShare. Demos are on GitHub.</p><p>SlideShare: www.slideshare.net/ActiveNick</p><p>Blog: www.AgeofMobility.com</p><p>Twitter: @ActiveNick </p><p>Mobile Apps: www.bigbaldapps.com</p><p>LinkedIn: www.linkedin.com/in/activenick</p><p>GitHub: github.com/ActiveNick</p><p>Email: nick.landry@microsoft.com</p></li></ul>