SlideShare uma empresa Scribd logo
1 de 27
Xamarin
Mobile Cross Platform Development in Visual Studio
bryan costanich
em: bryanc@xamarin.com
tw: @bryancostanich
slides:
slideshare.net/bryancostanich/crossplatform-
mobile-development-in-visual-studio
Sample Code
github.com/xamarin/mobile-samples/TaskyPro
Xamarin Platform
One Language +

                                  C#
    Framework
    LINQ
    Lambdas
    Task Parallel Library (TPL)
    Compile-Time Checks
    Garbage Collection



º
Native Perf. + UX
    Compiles Down to Native Code
    Not Interpreted
    All Native UX Controls
    Full Platform SDK Access
    iOS: Selectors/Obj-C Runtime
    Android: JNI
    Fast Enough for Games

º
Reuse Story
    C# Libraries
    Obj-C Bindings + Binding Projects
    .jar Bindings + Binding Projects
    C via pInvoke
    C++ via Cxxi




º
Other Platforms
Windows - via .NET
Mac - via Xamarin.Mac
Linux - via Mono
Etc.
Community +
    Support
    Huge C# Community
    StackOverflow.com
    IRC + chat.xamarin.com
    Great Support




º
General XPlat Considerations
Design Platform-Specific UX
    UX in iOS != Android != Windows
    Phone
    UX Metaphors are Different:
    Navigation Controller vs. Back
    Button
    Write-Once, Run-Anywhere is
    Problematic
    Users Expect Native UX
º
Choose Device
    Targets
    iPhone != iPad
    Beware Android Fragmentation
    Form Factor + Capability Differences
    Inform UX
    Pro-Tip: Minimize Targets


º
Building an X-Plat Architecture
Architecture
    Layers
    Separation of Responsibility
    Encapsulation
    Core Code Sharing




º
VS Project/Solution Setup
Code Sharing - Linking vs. PCL
    Portal Library Projects - Take a Lot of Work
    Great Discussion Here:
    http://forums.xamarin.com/discussion/28/challenges-thoughts-loves/p1
    Takeaway:
    PCL is clean, but difficult to implement
    Linking is less “clean” but simpler
    Our Recommendation Now: File Linking for Most Projects
    Walkthrough Here: Linking

º
WP7 + Android
    New 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"




º
iOS - Visual Studio 2012
    VS MonoTouch Plugin:
      https://github.com/ste8/VSMonoTouch
    Visual Studio SDK (to build plugin):
      http://msdn.microsoft.com/en-us/library/bb166441(v=vs.80).aspx


    iOS - Visual Studio 2010
    VS MonoTouch Plugin:
     https://github.com/follesoe/VSMonoTouch


º
.csproj edit:
    iOS - Plugin Config                           <ItemGroup> <Reference
                                                  Include="mscorlib" />
    Create iOS Project (on Mac): "[AppName].iOS"<Reference
    Copy to Solution Directory or Synch in Source Include="monotouch" />
    Manually Edit iOS .csproj File, add Refs ->   <Reference
                                                  Include="System" />
    Remove CoreLib Reference ->                   <Reference
                                                  Include="System.Xml" />
    Limitations: Can Build, but No Designer, or   <Reference
    Deployment                                    Include="System.Core" />
     (must use Mac for now**)                         </ItemGroup>

º
Shared Code Linking
    Two Linking Options: Auto or Manual
    Auto: Use Project Linker VS Add-In
     Add a project link, voila. (2010 + 2012)
    Manual: Link Files
     Add Files as Links




º
Shared Data +
    Data Access
    Layer
    Data Access
    Layer
    SQLite on iOS + Android, C# SQLIte on WP7:
     http://code.google.com/p/csharp-sqlite/
    SQLite.NET ORM
    Use Generics for CRUD Convenience Methods:
     TaskDatabase.cs



º
Platform Abstractions
Handling Divergence and Taking Advantage of Platform
Features
Conditional
Compilation
Pre-Defined Symbols:
 #if __ANDROID__
 #if WINDOWS_PHONE
 #if SILVERLIGHT
Can Add Additional in Build Settings
Class Abstraction
    Sometimes, You Wanna Provide
    Different Implementations for Different
    Platforms
    Partial Classes
    Partial Methods
    Interfaces




º
Xamarin.Mobile
XPlat API Abstractions
Xamarin.com/MobileAPI


                              Compass +
  Contacts     Geolocation   Acceleromete   Camera   Notifications
                                   r
Other XPlat Libs
    MonoCross - http://code.google.com/p/monocross/
    MvvmCross - https://github.com/slodge/MvvmCross
    Vernacular - https://github.com/rdio/vernacular
    MonoGame - http://monogame.codeplex.com/




º
Q+A

Mais conteúdo relacionado

Mais procurados

JavaScript on HP webOS: Enyo and Node.js
JavaScript on HP webOS: Enyo and Node.jsJavaScript on HP webOS: Enyo and Node.js
JavaScript on HP webOS: Enyo and Node.js
Ben Combee
 
Debugging IE Performance Issues with xperf, ETW and NavigationTiming
Debugging IE Performance Issues with xperf, ETW and NavigationTimingDebugging IE Performance Issues with xperf, ETW and NavigationTiming
Debugging IE Performance Issues with xperf, ETW and NavigationTiming
Nicholas Jansma
 
Sencha touchonbb10 bootcamp
Sencha touchonbb10 bootcampSencha touchonbb10 bootcamp
Sencha touchonbb10 bootcamp
n_adam_stanley
 

Mais procurados (20)

Modern JavaScript Frameworks: Angular, React & Vue.js
Modern JavaScript Frameworks: Angular, React & Vue.jsModern JavaScript Frameworks: Angular, React & Vue.js
Modern JavaScript Frameworks: Angular, React & Vue.js
 
30 Tools for Modern .NET Web Development in 60 Minutes (Jonathan Tower)
30 Tools for Modern .NET Web Development in 60 Minutes (Jonathan Tower)30 Tools for Modern .NET Web Development in 60 Minutes (Jonathan Tower)
30 Tools for Modern .NET Web Development in 60 Minutes (Jonathan Tower)
 
Gaikan
GaikanGaikan
Gaikan
 
Parse par Nicolas Lauquin
Parse par Nicolas LauquinParse par Nicolas Lauquin
Parse par Nicolas Lauquin
 
Lezione 02 React and React Native installation and Configuration
Lezione 02   React and  React Native installation and ConfigurationLezione 02   React and  React Native installation and Configuration
Lezione 02 React and React Native installation and Configuration
 
Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!
 
Electron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologiesElectron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologies
 
BlackBerry WebWorks
BlackBerry WebWorksBlackBerry WebWorks
BlackBerry WebWorks
 
20150728 100분만에 배우는 windows 10 앱 개발
20150728 100분만에 배우는 windows 10 앱 개발20150728 100분만에 배우는 windows 10 앱 개발
20150728 100분만에 배우는 windows 10 앱 개발
 
JavaScript on HP webOS: Enyo and Node.js
JavaScript on HP webOS: Enyo and Node.jsJavaScript on HP webOS: Enyo and Node.js
JavaScript on HP webOS: Enyo and Node.js
 
CapitolJS: Enyo, Node.js, & the State of webOS
CapitolJS: Enyo, Node.js, & the State of webOSCapitolJS: Enyo, Node.js, & the State of webOS
CapitolJS: Enyo, Node.js, & the State of webOS
 
An Introduction to Google Chrome OS..........
An Introduction to Google Chrome OS..........An Introduction to Google Chrome OS..........
An Introduction to Google Chrome OS..........
 
Building a Next Generation Mobile Browser using Web technologies
Building a Next Generation Mobile Browser using Web technologiesBuilding a Next Generation Mobile Browser using Web technologies
Building a Next Generation Mobile Browser using Web technologies
 
Ionic adventures - Hybrid Mobile App Development rocks
Ionic adventures - Hybrid Mobile App Development rocksIonic adventures - Hybrid Mobile App Development rocks
Ionic adventures - Hybrid Mobile App Development rocks
 
Google chrome
Google chromeGoogle chrome
Google chrome
 
Debugging IE Performance Issues with xperf, ETW and NavigationTiming
Debugging IE Performance Issues with xperf, ETW and NavigationTimingDebugging IE Performance Issues with xperf, ETW and NavigationTiming
Debugging IE Performance Issues with xperf, ETW and NavigationTiming
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day training
 
Sencha touchonbb10 bootcamp
Sencha touchonbb10 bootcampSencha touchonbb10 bootcamp
Sencha touchonbb10 bootcamp
 
Sg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanleySg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanley
 
What's new in ios 7.0
What's new in ios 7.0What's new in ios 7.0
What's new in ios 7.0
 

Semelhante a Cross-Platform Mobile Development in Visual Studio

Synapseindia android apps intro to android development
Synapseindia android apps  intro to android developmentSynapseindia android apps  intro to android development
Synapseindia android apps intro to android development
Synapseindiappsdevelopment
 
Android crash course
Android crash courseAndroid crash course
Android crash course
Showmax Engineering
 
4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트
4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트 4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트
4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트
양 한빛
 

Semelhante a Cross-Platform Mobile Development in Visual Studio (20)

Building Cross-Platform Mobile Apps
Building Cross-Platform Mobile AppsBuilding Cross-Platform Mobile Apps
Building Cross-Platform Mobile Apps
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
C# rocks
C# rocksC# rocks
C# rocks
 
Bienvenido .Net MAUI - la evolución de Xamarin.Forms
Bienvenido .Net MAUI - la evolución de Xamarin.FormsBienvenido .Net MAUI - la evolución de Xamarin.Forms
Bienvenido .Net MAUI - la evolución de Xamarin.Forms
 
Synapseindia android apps intro to android development
Synapseindia android apps  intro to android developmentSynapseindia android apps  intro to android development
Synapseindia android apps intro to android development
 
Visual Studio 2017 Launch Event
Visual Studio 2017 Launch EventVisual Studio 2017 Launch Event
Visual Studio 2017 Launch Event
 
Android crash course
Android crash courseAndroid crash course
Android crash course
 
Flutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textFlutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - text
 
Visual Studio for Mac (AltConf 2017)
Visual Studio for Mac (AltConf 2017)Visual Studio for Mac (AltConf 2017)
Visual Studio for Mac (AltConf 2017)
 
Cross-platform mobile dev with Mono
Cross-platform mobile dev with MonoCross-platform mobile dev with Mono
Cross-platform mobile dev with Mono
 
Electron
ElectronElectron
Electron
 
4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트
4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트 4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트
4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트
 
Welcome to the microsoft madness
Welcome to the microsoft madnessWelcome to the microsoft madness
Welcome to the microsoft madness
 
Cross platform mobile app development tools review
Cross platform mobile app development tools reviewCross platform mobile app development tools review
Cross platform mobile app development tools review
 
Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015
 
Angularjs Tutorial for Beginners
Angularjs Tutorial for BeginnersAngularjs Tutorial for Beginners
Angularjs Tutorial for Beginners
 
Tutorial: Develop Mobile Applications with AngularJS
Tutorial: Develop Mobile Applications with AngularJSTutorial: Develop Mobile Applications with AngularJS
Tutorial: Develop Mobile Applications with AngularJS
 
Cloud development technology sharing (BlueMix premier)
Cloud development technology sharing (BlueMix premier)Cloud development technology sharing (BlueMix premier)
Cloud development technology sharing (BlueMix premier)
 
Droidcon uk2012 androvm
Droidcon uk2012 androvmDroidcon uk2012 androvm
Droidcon uk2012 androvm
 
X-Platform native apps in C# and .NET using Xamarin tools (iOS/WP/Android)
X-Platform native apps in C# and .NET using Xamarin tools (iOS/WP/Android)X-Platform native apps in C# and .NET using Xamarin tools (iOS/WP/Android)
X-Platform native apps in C# and .NET using Xamarin tools (iOS/WP/Android)
 

Mais de bryan costanich

Advanced android app lifecycle + Patterns
Advanced android app lifecycle + PatternsAdvanced android app lifecycle + Patterns
Advanced android app lifecycle + Patterns
bryan costanich
 
Cross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with XamarinCross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with Xamarin
bryan costanich
 
Going mobile - A Technical Job Prep for Vassar Students
Going mobile - A Technical Job Prep for Vassar StudentsGoing mobile - A Technical Job Prep for Vassar Students
Going mobile - A Technical Job Prep for Vassar Students
bryan costanich
 

Mais de bryan costanich (8)

Hardware hackers - hacking appliances with netduino + xamarin
Hardware hackers - hacking appliances with netduino + xamarinHardware hackers - hacking appliances with netduino + xamarin
Hardware hackers - hacking appliances with netduino + xamarin
 
Teardown Conference: hacking appliances with netduino + xamarin
Teardown Conference: hacking appliances with netduino + xamarinTeardown Conference: hacking appliances with netduino + xamarin
Teardown Conference: hacking appliances with netduino + xamarin
 
Hacking your coffee maker; building a connected appliance with Netduino and X...
Hacking your coffee maker; building a connected appliance with Netduino and X...Hacking your coffee maker; building a connected appliance with Netduino and X...
Hacking your coffee maker; building a connected appliance with Netduino and X...
 
Futures in Computing
Futures in Computing Futures in Computing
Futures in Computing
 
Advanced android app lifecycle + Patterns
Advanced android app lifecycle + PatternsAdvanced android app lifecycle + Patterns
Advanced android app lifecycle + Patterns
 
Cross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with XamarinCross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with Xamarin
 
Going mobile - A Technical Job Prep for Vassar Students
Going mobile - A Technical Job Prep for Vassar StudentsGoing mobile - A Technical Job Prep for Vassar Students
Going mobile - A Technical Job Prep for Vassar Students
 
Cross Platform Development with Xamarin
Cross Platform Development with XamarinCross Platform Development with Xamarin
Cross Platform Development with Xamarin
 

Último

Último (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Cross-Platform Mobile Development in Visual Studio

  • 1. Xamarin Mobile Cross Platform Development in Visual Studio
  • 2. bryan costanich em: bryanc@xamarin.com tw: @bryancostanich slides: slideshare.net/bryancostanich/crossplatform- mobile-development-in-visual-studio
  • 5. One Language + C# Framework LINQ Lambdas Task Parallel Library (TPL) Compile-Time Checks Garbage Collection º
  • 6. Native Perf. + UX Compiles Down to Native Code Not Interpreted All Native UX Controls Full Platform SDK Access iOS: Selectors/Obj-C Runtime Android: JNI Fast Enough for Games º
  • 7. Reuse Story C# Libraries Obj-C Bindings + Binding Projects .jar Bindings + Binding Projects C via pInvoke C++ via Cxxi º
  • 8. Other Platforms Windows - via .NET Mac - via Xamarin.Mac Linux - via Mono Etc.
  • 9. Community + Support Huge C# Community StackOverflow.com IRC + chat.xamarin.com Great Support º
  • 11. Design Platform-Specific UX UX in iOS != Android != Windows Phone UX Metaphors are Different: Navigation Controller vs. Back Button Write-Once, Run-Anywhere is Problematic Users Expect Native UX º
  • 12. Choose Device Targets iPhone != iPad Beware Android Fragmentation Form Factor + Capability Differences Inform UX Pro-Tip: Minimize Targets º
  • 13. Building an X-Plat Architecture
  • 14. Architecture Layers Separation of Responsibility Encapsulation Core Code Sharing º
  • 16. Code Sharing - Linking vs. PCL Portal Library Projects - Take a Lot of Work Great Discussion Here: http://forums.xamarin.com/discussion/28/challenges-thoughts-loves/p1 Takeaway: PCL is clean, but difficult to implement Linking is less “clean” but simpler Our Recommendation Now: File Linking for Most Projects Walkthrough Here: Linking º
  • 17. WP7 + Android New 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" º
  • 18. iOS - Visual Studio 2012 VS MonoTouch Plugin: https://github.com/ste8/VSMonoTouch Visual Studio SDK (to build plugin): http://msdn.microsoft.com/en-us/library/bb166441(v=vs.80).aspx iOS - Visual Studio 2010 VS MonoTouch Plugin: https://github.com/follesoe/VSMonoTouch º
  • 19. .csproj edit: iOS - Plugin Config <ItemGroup> <Reference Include="mscorlib" /> Create iOS Project (on Mac): "[AppName].iOS"<Reference Copy to Solution Directory or Synch in Source Include="monotouch" /> Manually Edit iOS .csproj File, add Refs -> <Reference Include="System" /> Remove CoreLib Reference -> <Reference Include="System.Xml" /> Limitations: Can Build, but No Designer, or <Reference Deployment Include="System.Core" /> (must use Mac for now**) </ItemGroup> º
  • 20. Shared Code Linking Two Linking Options: Auto or Manual Auto: Use Project Linker VS Add-In Add a project link, voila. (2010 + 2012) Manual: Link Files Add Files as Links º
  • 21. Shared Data + Data Access Layer Data Access Layer SQLite on iOS + Android, C# SQLIte on WP7: http://code.google.com/p/csharp-sqlite/ SQLite.NET ORM Use Generics for CRUD Convenience Methods: TaskDatabase.cs º
  • 22. Platform Abstractions Handling Divergence and Taking Advantage of Platform Features
  • 23. Conditional Compilation Pre-Defined Symbols: #if __ANDROID__ #if WINDOWS_PHONE #if SILVERLIGHT Can Add Additional in Build Settings
  • 24. Class Abstraction Sometimes, You Wanna Provide Different Implementations for Different Platforms Partial Classes Partial Methods Interfaces º
  • 25. Xamarin.Mobile XPlat API Abstractions Xamarin.com/MobileAPI Compass + Contacts Geolocation Acceleromete Camera Notifications r
  • 26. Other XPlat Libs MonoCross - http://code.google.com/p/monocross/ MvvmCross - https://github.com/slodge/MvvmCross Vernacular - https://github.com/rdio/vernacular MonoGame - http://monogame.codeplex.com/ º
  • 27. Q+A

Notas do Editor

  1. Fast Enough for Games Native UX means that apps look like they belong Full platform SDK Access means that anything you can do in Obj-C on iOS or Java in Android, you can do here. Animation libraries, Media libraries, etc.
  2. Need better graphic for this.
  3. Need Visual Studio Screenshot
  4. A good layered architecture allows for proper separation of responsibility and encapsulation, providing isolation to allow for code changes and maximizing code sharing between platforms. It also provides a pattern-agnostic framework so you can pick and choose which patterns you want to use, and then be flexible to changing them later on. And this is very simple to do. We’ll see later on how to accomplish this with proper namespacing and project setup.
  5. Xamarin supports portable library projects, but they pose practical problems in real-world scenarios because of dependencies. it eliminates the ability to use ifDefs, so you have to do massive architectural refactoring, use the provider/simple dependency pattern, etc. to solve even minor things. Best way, instead is to link your code.
  6. Don’t use .Android - the namespace will cause you hell
  7. Download install, and configure the plugin as state on the git page. Must create the initial MonoTouch application on a mac. Copy it over to your VS machine, into your project. or just synchronize in your source control. Edit the &lt;ItemGroup&gt; that has the “System” entry to include the mscorlib and monotouch items Finally, remove the mscorlib.dll reference in project settings : build : advanced.
  8. Download install, and configure the plugin as state on the git page. Must create the initial MonoTouch application on a mac. Copy it over to your VS machine, into your project. or just synchronize in your source control. Edit the &lt;ItemGroup&gt; that has the “System” entry to include the mscorlib and monotouch items Finally, remove the mscorlib.dll reference in project settings : build : advanced.
  9. Xamarin supports portable library projects, but they pose practical problems in real-world scenarios because of dependencies. it eliminates the ability to use ifDefs, so you have to do massive architectural refactoring, use the provider/simple dependency pattern, etc. to solve even minor things. Best way, instead is to link your code. There are two ways to do this. The magical way, or the manual way. Automatic linking is done fia the Project Linker VS Add-in. Manual is just plain old file links - your only option in MD. Simply add a project link to the corelib, and when you add/remove classes there, they’ll show up in your app projects. if you put your classes in folders, they’ll link nicely into your apps. The manual way is to simply add existing files and make sure they’re added as links.
  10. You can use SQLite on all three mobile platforms, iOS, Android, and WP7. on iOS and Android, SQLite is bundled with it, and on Windows Phone, you can use the open source C# port. We’ll show later how to easily support this cross platform with the same exact API. Additionally, we recommend SQLite.NET ORM for easy data access. For Data Access, we’ve added some nice convenience methods in TaskDatabase.cs that make the basic CRUD operations a snap with zero code.
  11. Platforms are different. pInvoke is available on iOS and Android, not on WP. SQLite is native on Android and iOS, on WP you have to use the C# lib. Devices also have different features. Cameras are different on nearly every single android device out there. Some devices have location features, some don’t. Some vary, etc.
  12. There are predefined symbols that allow you to use different code, depending on the platform you’re building for. Additionally, you can define your own symbols in Build Settings. Demo of this in use can be found here: TaskyPro :: CoreLib.DataLayer/SQLite.cs
  13. ITask - Interface TaskBase - Task class DialogTask - with MT.D annotations