Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Rise of Xamarin - August 2013

The Rise of Xamarin - August 2013

Xamarin continues to blossom with the release of 2.0 including Xamarin Studio, C# 5, Async, F#, and announcing Test Cloud. There's definitely a lot of momentum and excitement around this platform, and thankfully it has the substance to back it up.

Present at St. Louis ALT.NET http://www.meetup.com/stlaltdotnet/events/133172182/

340d396deb6c4987147b061705edcb54?s=128

David Ortinau

August 28, 2013
Tweet

Transcript

  1. The Rise of Xamarin: Mobile Development in C# Thursday, August

    29, 13
  2. David Ortinau @davidortinau http://davidortinau.com 17 yrs web, interactive, mobile. Xamarin

    MVP Flash, iPhone, Android, WP7 BA English, Maryville University Thursday, August 29, 13
  3. Thursday, August 29, 13

  4. Thursday, August 29, 13

  5. Thursday, August 29, 13

  6. I Don’t Hate Objective-C Thursday, August 29, 13

  7. I Don’t Hate JavaScript Or HTML5 Or HTML6 Or HTML7

    Or HTML8 Or HTML9 Thursday, August 29, 13
  8. Let’s Talk About • Cross Platform Holy Grail • What

    is Mono? • Who is Xamarin? • The World According to Xamarin Thursday, August 29, 13
  9. Write Once Run Anywhere Thursday, August 29, 13

  10. Thursday, August 29, 13

  11. Write Once Run Anywhere • Do you hate users?* •

    Most cross-platform solutions benefit developers and customers, but rarely value users and user experience. * kidding, of course you don’t. Users are cuddly. Thursday, August 29, 13
  12. Either/Or • Concessions are made to afford faster development and

    less code to target multiple platforms. • Typically you must learn a new, custom way of coding for the middle framework in order to use it and target multiple platforms. *learning new stuff is not bad. Embrace it. Then decide the best path. Thursday, August 29, 13
  13. iOS Programming: The Big Nerd Ranch Guide “An aspiring iOS

    developer faces three basic hurdles: You must learn the Objective-C language...You must master the big ideas... You must master the frameworks.” Thursday, August 29, 13
  14. Both/And • How can we achieve broad reach across platforms

    while: • reusing as much code as possible • not sacrificing user experience • not sacrificing performance • not sacrificing features Thursday, August 29, 13
  15. What is Mono? Thursday, August 29, 13

  16. Mono Overview • Run .Net code across multiple platforms •

    Project began in 2001 • Novell “held” project for years • Mono “died” when Novell was acquired April 2011 • Xamarin founded May 2011 Thursday, August 29, 13
  17. Key Parts • open source implementation of Microsoft's .Net Framework

    based on the Ecma standards for C# and the Common Language Runtime • Mono's C# compiler is feature complete for C# 1.0, 2.0, 3.0, 4.0, 5.0 (Ecma) • The runtime implements the Ecma Common Language Infrastructure (CLI). The runtime provides a Just-in-Time (JIT) compiler, an Ahead-of- Time compiler (AOT), a library loader, the garbage collector, a threading system and interoperability functionality. • August 2013: What’s new in Mono http://tirania.org/blog/archive/2013/Aug-20-1.html Thursday, August 29, 13
  18. Supported Platforms • Linux • Android • Mac OS X

    • iOS • BSD • Sun Solaris • Unix • Microsoft Windows • Nintendo Wii • Sony PlayStation 3 • XBox Thursday, August 29, 13
  19. Who is Xamarin? Thursday, August 29, 13

  20. Xamarin Rising • Miguel de Icaza, Nat Friedman, Joseph Hill

    • 20+ Members from the Mono team • Initially Self funded • Series A $12M July 2012 • Series B $16M July 2013 • 20,000+ Paid Developer Seats • 350,000 Members • Gartner Award “Mobile Visionary” • Selling • Xamarin.Mac, Xamarin.iOS, Xamarin.Android, Test Cloud • Support Contracts • Other projects include MonoGame, Playscript, Xamarin.Mobile, Xamarin.Social, Xamarin.Auth Thursday, August 29, 13
  21. XobotOS • Android Ported to C# • Sharpen - code

    conversion tool • http://blog.xamarin.com/2012/05/01/android-in-c-sharp/ • https://github.com/xamarin/XobotOS • https://github.com/xamarin/XobotOS/tree/master/sharpen Thursday, August 29, 13
  22. Thursday, August 29, 13

  23. Miguel “A project that we started because we thought it

    would be fun to do has turned out to yield some serious benefits for our products. It’s important for a startup to stay focused, but sometimes you have to try something crazy to make progress. And who knows, maybe Google will thank us some day.” Thursday, August 29, 13
  24. Thursday, August 29, 13

  25. Text Thursday, August 29, 13

  26. How will it scale? Thursday, August 29, 13

  27. Thursday, August 29, 13

  28. Thursday, August 29, 13

  29. PlayScript • Zynga open sourced • Xamarin working to fully

    integrate into Mono • Superset of Actionscript • With C# 5 Features • Optionally strong typed • Dual compiler: C# and PlayScript side by side in the same project • Full Xamarin Studio support • PlayScript/Actionscript Stage3D / OpenGL • Starling & Away3D • https://github.com/playscript Thursday, August 29, 13
  30. Thursday, August 29, 13

  31. The World According to Xamarin Thursday, August 29, 13

  32. Thursday, August 29, 13

  33. Compiles a native binary • not cross compiled • not

    interpreted Thursday, August 29, 13
  34. Platform Runtime C# UI WP8 iOS Android .NET Mono Business

    Logic Silverlight Xamarin.iOS Xamarin.Android Thursday, August 29, 13
  35. Requirements • Xamarin.iOS • Mac OS X and Xamarin Studio

    • Windows and Visual Studio w/ Xamarin plugin, or Xamarin Studio • required Mac build machine • Xamarin.Android • Mac OS X or Windows • Xamarin Studio or Visual Studio 2010 • Windows Phone • Windows • Visual Studio 2010 Thursday, August 29, 13
  36. Runtime • Mono 3.2 • .NET 4.5 • C# 5

    Thursday, August 29, 13
  37. New in Xamarin 2.0 • Xamarin Studio & Component Store

    • Async await support • Portable Class Libraries • Improved SGen GC • Incremental builds • Reactive Extensions • F# • Razor • Entity Framework • ASP.NET WebStack • Cocos2D Port Thursday, August 29, 13
  38. Compiling • Apple doesn’t allow runtime compilation so Xamarin.iOS provides

    Ahead-of-Time compilation • Publish directly to TestFlight • Android allows it, so Xamarin.Android employs Just-in-Time compilation Thursday, August 29, 13
  39. Bindings • Follow the conventions of the native platform •

    UIViewController • UITableViewController • Create custom Bindings for 3rd party libraries Thursday, August 29, 13
  40. Memory Management • Obj-C is retain count* • Xamarin.iOS abstracts

    this adding Garbage Collection • Most classes expose a Dispose() method *newer iOS provides Automatic Reference Counting (ARC) that makes this less of a burden Thursday, August 29, 13
  41. Delegates • Obj-C makes heavy use of delegation • C#

    provides delegation methods • C# replaces most with events Thursday, August 29, 13
  42. Code Sharing • View code is platform specific • Business

    logic can be shared across all platforms using • Portable Class Libraries • Shared Libraries • Linked Files • Other methods • Partial Classes • Conditional Compilation • Default platform symbols provided Thursday, August 29, 13
  43. Persistence • Isolated Storage • Read/Write from file using XMLSerializer

    • Database • Sql Server Compact Edition - WP7 • sqlite - iOS and Android • For WP7 • C#-SQLite - APIs http://code.google.com/p/csharp-sqlite/ • sqlite-net - ORM https://github.com/praeclarum/sqlite-net Thursday, August 29, 13
  44. Testing • NUnitLite http://www.nunitlite.com/ • Thursday, August 29, 13

  45. Xamarin.Mobile • Base class library for mobile services • Location

    • Contacts • Photos • Decrease the amount of platform-specific code needed to perform common tasks • http://components.xamarin.com/view/ xamarin.mobile/ • https://github.com/xamarin/Xamarin.Mobile Thursday, August 29, 13
  46. Xamarin.Auth • Simplify authentication • OAuth 1.0 and 2.0 •

    Includes • Facebook • Google • Foursquare • http://components.xamarin.com/view/xamarin.auth/ • https://github.com/xamarin/Xamarin.Auth Thursday, August 29, 13
  47. Xamarin.Social • Posts statuses, links, images/media to social networks •

    Access social network APIs using authenticated requests. • Automatically and securely store user credentials using Xamarin.Auth. • Cross Platform • Extensible, currently has support for: • App.net • Facebook • Flickr • Pinterest • Twitter • http://components.xamarin.com/view/xamarin.social/ • https://github.com/xamarin/Xamarin.Social Thursday, August 29, 13
  48. Popular Libraries • TinyMessenger http://hg.grumpydev.com/tinyioc/wiki/TinyMessenger • TinyIoC http://hg.grumpydev.com/tinyioc/wiki/Home • RestSharp

    http://restsharp.org/ • MonoCross http://code.google.com/p/monocross/ • MvvmCross https://github.com/slodge/MvvmCross • MvvmLight http://www.galasoft.ch/mvvm/ • C#-SQLite http://code.google.com/p/csharp-sqlite/ • sqlite-net https://github.com/praeclarum/sqlite-net Thursday, August 29, 13
  49. More Links • MWC 2012 App https://github.com/xamarin/mobile-samples/tree/master/MWC • NYC Code

    Camp 6 App https://github.com/gshackles/NycCodeCamp6 • Mobile Development in C# http://amzn.com/1449320236 • Evolve Presentations http://xamarin.com/evolve/2013 • Monkeyspace http://monkeyspace.org/ • https://github.com/davidortinau • https://github.com/xamarin Thursday, August 29, 13
  50. Thanks! @davidortinau http://davidortinau.com dave@davidortinau.com Thursday, August 29, 13