26
Xamarin Mobile Cross Platform Development

Cross Platform Mobile Development with Xamarin

Embed Size (px)

Citation preview

Page 1: Cross Platform Mobile Development with Xamarin

XamarinMobile Cross Platform Development

Page 2: Cross Platform Mobile Development with Xamarin

bryan costanichem: [email protected]: @bryancostanichslides: slideshare.net/bryancostanich

Page 3: Cross Platform Mobile Development with Xamarin

Sample Codegithub.com/xamarin/mobile-samples/TaskyProblog.xamarin.com

Page 4: Cross Platform Mobile Development with Xamarin

Xamarin Platform(The Pitch)

Page 5: Cross Platform Mobile Development with Xamarin

One Language + FrameworkLINQLambdasTask Parallel Library (TPL)Compile-Time ChecksGarbage Collection

C#º

Page 6: Cross Platform Mobile Development with Xamarin

Native Perf. + UXCompiles Down to Native CodeNot InterpretedAll Native UX ControlsFull Platform SDK AccessiOS: Selectors/Obj-C RuntimeAndroid: JNIFast Enough for Games

º

Page 7: Cross Platform Mobile Development with Xamarin

Reuse StoryC# LibrariesObj-C Bindings + Binding Projects.jar Bindings + Binding ProjectsC via pInvokeC++ via Cxxi

º

Page 8: Cross Platform Mobile Development with Xamarin

Other PlatformsWindows - via .NETMac - via Xamarin.MacLinux - via MonoOuya, XBOX, PSP, etc.Etc.

Page 9: Cross Platform Mobile Development with Xamarin

Community + SupportHuge C# CommunityStackOverflow.comforums.xamarin.comIRC + chat.xamarin.comGreat Support

º

Page 10: Cross Platform Mobile Development with Xamarin

VS + Xamarin Studio

Visual StudioXamarin StudioAndroid DesigneriOS Designer (Beta)DebuggingAutoCompleteRefactoringProject ManagementIntegrated Source Control

Page 11: Cross Platform Mobile Development with Xamarin

General XPlat Considerations

Page 12: Cross Platform Mobile Development with Xamarin

Design Platform-Specific UX

UX in iOS != Android != Windows PhoneUX Metaphors are Different: Navigation Controller vs. Back ButtonWrite-Once, Run-Anywhere is ProblematicUsers Expect Native UX

º

Page 13: Cross Platform Mobile Development with Xamarin

Choose Device TargetsiPhone != iPadBeware Android FragmentationForm Factor + Capability Differences Inform UXPro-Tip: Minimize Targets

º

Page 14: Cross Platform Mobile Development with Xamarin

Building an X-Plat Architecture

Page 15: Cross Platform Mobile Development with Xamarin

ArchitectureLayersSeparation of ResponsibilityEncapsulationCore Code Sharing

º

Page 16: Cross Platform Mobile Development with Xamarin

VS Project/Solution Setup

Page 17: Cross Platform Mobile Development with Xamarin

Code Sharing - Linking vs. PCLPortal Library Projects - Take a Lot of WorkGreat Discussion Here: http://forums.xamarin.com/discussion/28/challenges-thoughts-loves/p1Takeaway: PCL is clean, but difficult to implementLinking is less “clean” but simplerOur Recommendation Now: File Linking for Most ProjectsWalkthrough Here: Linkingº

Page 18: Cross Platform Mobile Development with Xamarin

WP7 + AndroidNew Blank Solution: "[AppName]"New C# Lib Project: "[AppName].Core"Test Project: “[AppName].Core.Tests”New Mono for Android Project: “[AppName].Droid”New WP7 Project "[AppName].WP7"

º

Page 19: Cross Platform Mobile Development with Xamarin

Shared Data + Data Access Layer

SQLite on iOS + Android, C# SQLIte on WP7: http://code.google.com/p/csharp-sqlite/SQLite.NET ORMUse Generics for CRUD Convenience Methods: TaskDatabase.cs

º

Page 20: Cross Platform Mobile Development with Xamarin

Platform AbstractionsHandling Divergence and Taking Advantage of Platform Features

Page 21: Cross Platform Mobile Development with Xamarin

Conditional CompilationPre-Defined Symbols: #if __MOBILE__ #if __ANDROID__ #if __IOS__ #if WINDOWS_PHONE #if SILVERLIGHTCan Add Additional in Build Settings

Page 22: Cross Platform Mobile Development with Xamarin

Architectural AbstractionSometimes, You Wanna Provide Different Implementations for Different PlatformsInterfaces

º

Page 23: Cross Platform Mobile Development with Xamarin

Component StoreTons of ComponentsCross-PlatformIDE-Integration - drop-in!Revenue Model for User Submitted

Page 24: Cross Platform Mobile Development with Xamarin

Xamarin.* Libraries XPlat API AbstractionsOpen SourceGithub.com/Xamarin/Xamarin.*

Mobile Social Auth

Page 25: Cross Platform Mobile Development with Xamarin

Other XPlat LibsMonoCross - http://code.google.com/p/monocross/MvvmCross - https://github.com/slodge/MvvmCrossVernacular - https://github.com/rdio/vernacularMonoGame - http://monogame.netCocos2D - http://cocos2DXNA.net

º

Page 26: Cross Platform Mobile Development with Xamarin

Q+A