Cross Platform Mobile Development with.NET Greg Shackles Senior Software Engineer OLO Online Ordering
MARQUEE SPONSOR
PLATINUM SPONSOR
GOLD SPONSOR
SILVER SPONSORS
Who is this guy? Greg Shackles gregshackles.com Google+: plus.tl/gshacklesplus.tl/gshackles github.com/gshackles
C# To Go
Market Share (US)
Platform Languages
Cross Platform Solutions and many more…
Spoiler Alert
Different Platforms are…Different !=
.NET to the Rescue!
What is Mono? Implementation of the.NET CLR Open source Cross platform Supports most of.NET 4.0 mono-project.com
MonoTouch Bindings to CocoaTouch.NET – LINQ, generics, etc (Moonlight) AOT compilation Linker Memory management Integrates with Interface Builder ios.xamarin.com
Mono for Android Wraps Java/Android API.NET – LINQ, generics, etc (Moonlight) Linker Visual Studio 2010 or MonoDevelop android.xamarin.com
Mono for Android Architecture Android/Managed Callable Wrappers JNI bridges to talk between Android and Mono
Mono for Android API.NET events replace listener interfaces Action replaces Runnable Enumerations Properties Attributes and tooling generate configuration Uses standard Android resource files
Why?
Sharing
Reusability Story UI C# Runtime Platform Silverlight Business Logic.NET WP7 iOS Mono Android MonoTouch Mono for Android
Platform Comparison UI Tooling – IDE – Designer – Emulator Multitasking / Lifecycle Storage – File system – Database Shared Resources
Comparison: Views WP7iOSAndroid Format XAMLXIBXML Screen PhoneApplicationPageUIViewControllerActivity Layout StackPanelN/A(manual)LinearLayout List ListBoxUITableViewListView List Item ListBox.ItemTemplateUITableViewCellView Data Source BindingUITableViewSourceBaseAdapter
Comparison: Navigation Windows Phone 7 NavigationService.Navigate( new Uri("/NextPage.xaml?id=42", UriKind.Relative))); iOS NavigationController.PushViewController( new NextController(42), true); Android var intent = new Intent(); intent.SetClass(this, typeof (NextActivity)); intent.PutExtra(id", 42); StartActivity(intent);
Code Sharing Techniques Link files Preprocessor directives #if MONOTOUCH Messaging (publish/subscribe) Abstraction Third party libraries – sqlite-net – TinyIoC / TinyMessenger – MonoMobile.Extensions
NYC Code Camp App
App Architecture Entities DataAccess Libraries Messaging ViewModels CC.Core.MonoTouch CC.Core.MonoAndroid CC.Core.WP7 CodeCamp.Core App.MonoTouch App.MonoAndroid App.WP7
Questions? 15% Discount - Expires 10/31