Introduction to Xamarin

Preview:

DESCRIPTION

Presentation we delivered for the the GRMobileDev meetup (http://www.meetup.com/Grand-Rapids-Mobile-Development-Group/events/141015692/) on 10/2/2013. We introduced the Grand Rapids, MI mobile dev community to Xamarin and leveraging C# cross platform.

Citation preview

Enterprise Mobile AppsXamarin and C#

We Love This Stuff

About Us (http://www.ostusa.com/app-dev)

• Brian Anderson• Founder of OST’s app dev practice / Business Dev• Crowe -> SageStone -> NuSoft -> OST

• Nick Westbrook• Sr. Consultant (worked on ArtPrize 1.0)• … -> Spout -> Family Christian -> OST

• Mike Perry• Sr. Consultant • NuSoft -> Amway -> KPMG -> OST

• Alex Jantz• Consultant• Belcan (Aerospace dev and EE) -> OST

Xamarin History (via Wikipedia)• In June 2000, Microsoft first announced their .NET Framework.[4] Miguel de Icaza of Ximian began

investigating whether a Linux version was feasible.[5] The Mono open source project was launched on July 19, 2001. Ximian was bought by Novell on August 4, 2003.

• After the acquisition of Novell by Attachmate in April 2011, Attachmate announced hundreds of layoffs for the Novell workforce, including Mono developers,[6]putting the future of Mono in question.[7][8]

• On May 16, 2011, Miguel De Icaza announced on his blog that Mono would be developed and supported by Xamarin, which planned to release a new suite of mobile products. According to De Icaza, at least part of the original Mono team had moved to the new company.[9]

• After this announcement, the future of the project was questioned, since MonoTouch and Mono for Android would now be in direct competition with the existing commercial offerings owned by Attachmate, and considering that the Xamarin team would have difficulty proving that they had not used technologies previously developed when they were employed by Novell for the same work.[10][11]

• In July 2011, however, Novell, now a subsidiary of Attachmate, and Xamarin announced that Novell had granted a perpetual license for Mono, MonoTouch and Mono for Android to Xamarin, which formally and legally took official stewardship of the project.[12][13]

• In December 2012, Xamarin released Xamarin.Mac,[14] a plugin for the existing MonoDevelop Integrated development environment (IDE), allowing developers to build C#-based applications for the Apple OS X operating system and package them for publishing via the Apple App Store.

• In February 2013, Xamarin announced the release of Xamarin 2.0.[15] The release included two main components: Xamarin Studio, which bundled Xamarin's previous, separate iOS, Android and Apple OS X development tools into a single application;[16] and integration with Visual Studio, Microsoft's IDE for the .NET Framework, allowing Visual Studio to be used for creating applications for iOS and Android, as well as for Windows.

Xamarin Framework History

•Mono• C# + .NET implementation for Linux• started in 2001/released 2004 (C# 1.0)

•MonoTouch (for iOS) – 2009 (iPhone OS 3.0, pre-ipad)

•Mono for Android – 2011 (Android 2.3 Gingerbread)

•MonoDevelop IDE•MonoMac open source project

Why Xamarin?• Apps are native, performance is native• Entire platform SDK available to your code:• iOS: StoreKit, EventKit, iCloud, etc• Android: Play Services, Compatibility Library, etc

• Share C# across Xamarin, Windows & WinPhone apps• Leverage platform-specific libraries:• iOS: Objective-C• Android: Java

Why does this matter?

1. User experience2. Performance3. Features

We don’t believe that HTML5 apps give a truly native experience•Proof = Facebook Apps

How does it work?

How does it work?

Xamarin Development Environments

iOS apps in Visual Studio

DemoXamarin Studio (Mac & Windows), Visual Studio, Debugging, Storyboards

Enterprise Mobile Apps

Real Enterprise Project Experience• Project description• Starting with iPhone• Building on top of large infrastructure with existing RESTful API and a

common domain library• Leveraging an enterprise Onion Architecture

• Domain driven design• Domain services• App services• UI per platform• Defined infrastructure layers for communication and data abstraction

• Dependency Injection• ORM with Linq support• Repository patterns

• We wanted to leverage components (ie Charts & more) to save time and $

DemoHow are we architecting it? Where are we at in the dev cycle?

Pro / Cons

Pros

• C# - makes for fast coding of back-end patterns• Lots of shared code cross-

platform• Clean IDE, easy to pick up

and run with

Cons• New platform

• Still gaining support for things like AutoMapper, Ninject, and PCL’s

• SVN add-in needs work (or remove it completely. We really need this project to migrate to Git anyway.)• Poor Storyboard stability when

used with SVN• File linking in the presentation

layers can be a pain

Tips• If using SVN: Use Xcode to install the Command Line

Tools (if not already installed) and use Terminal to run SVN commands.• You can create XIB (nib) files for complex views and

avoid using the Storyboard• Expect a learning curve if you haven’t worked with iOS

view controllers before

Something Fun

Skunk works• Azure Mobile Services• Android / iOS with shared core• Including communication with on premise Web API

• Custom microcontroller designed using ElectricImp.com• A stop light

Let the final demo begin…

How it works

Circuit

Questions / Thoughts