Upload
bryancostanich
View
1.998
Download
2
Embed Size (px)
Citation preview
XamarinMobile Cross Platform Development
bryan costanichem: [email protected]: @bryancostanichslides: slideshare.net/bryancostanich
Sample Codegithub.com/xamarin/mobile-samples/TaskyProblog.xamarin.com
Xamarin Platform(The Pitch)
One Language + FrameworkLINQLambdasTask Parallel Library (TPL)Compile-Time ChecksGarbage Collection
C#º
Native Perf. + UXCompiles Down to Native CodeNot InterpretedAll Native UX ControlsFull Platform SDK AccessiOS: Selectors/Obj-C RuntimeAndroid: JNIFast Enough for Games
º
Reuse StoryC# LibrariesObj-C Bindings + Binding Projects.jar Bindings + Binding ProjectsC via pInvokeC++ via Cxxi
º
Other PlatformsWindows - via .NETMac - via Xamarin.MacLinux - via MonoOuya, XBOX, PSP, etc.Etc.
Community + SupportHuge C# CommunityStackOverflow.comforums.xamarin.comIRC + chat.xamarin.comGreat Support
º
VS + Xamarin Studio
Visual StudioXamarin StudioAndroid DesigneriOS Designer (Beta)DebuggingAutoCompleteRefactoringProject ManagementIntegrated Source Control
General XPlat Considerations
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
º
Choose Device TargetsiPhone != iPadBeware Android FragmentationForm Factor + Capability Differences Inform UXPro-Tip: Minimize Targets
º
Building an X-Plat Architecture
ArchitectureLayersSeparation of ResponsibilityEncapsulationCore Code Sharing
º
VS Project/Solution Setup
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º
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"
º
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
º
Platform AbstractionsHandling Divergence and Taking Advantage of Platform Features
Conditional CompilationPre-Defined Symbols: #if __MOBILE__ #if __ANDROID__ #if __IOS__ #if WINDOWS_PHONE #if SILVERLIGHTCan Add Additional in Build Settings
Architectural AbstractionSometimes, You Wanna Provide Different Implementations for Different PlatformsInterfaces
º
Component StoreTons of ComponentsCross-PlatformIDE-Integration - drop-in!Revenue Model for User Submitted
Xamarin.* Libraries XPlat API AbstractionsOpen SourceGithub.com/Xamarin/Xamarin.*
Mobile Social Auth
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
º
Q+A