SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere Àhnliche Inhalte

Was ist angesagt?

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.jsJonas Bandi
 
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)ITCamp
 
Parse par Nicolas Lauquin
Parse par Nicolas LauquinParse par Nicolas Lauquin
Parse par Nicolas LauquinCocoaHeads France
 
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 ConfigurationUniversity of Catania
 
Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Jonas Bandi
 
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 technologiesBethmi Gunasekara
 
BlackBerry WebWorks
BlackBerry WebWorksBlackBerry WebWorks
BlackBerry WebWorksBhasker Thapan
 
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.jsBen Combee
 
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 webOSBen Combee
 
An Introduction to Google Chrome OS..........
An Introduction to Google Chrome OS..........An Introduction to Google Chrome OS..........
An Introduction to Google Chrome OS..........VAST TRICHUR
 
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 technologiesn_adam_stanley
 
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 rocksJuarez Filho
 
Google chrome
Google chromeGoogle chrome
Google chromeNayana_Bingi
 
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 NavigationTimingNicholas Jansma
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day trainingTroy Miles
 
Sencha touchonbb10 bootcamp
Sencha touchonbb10 bootcampSencha touchonbb10 bootcamp
Sencha touchonbb10 bootcampn_adam_stanley
 
Sg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanleySg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanleyn_adam_stanley
 

Was ist angesagt? (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
 

Ähnlich wie Cross-Platform Mobile Development in Visual Studio

Building Cross-Platform Mobile Apps
Building Cross-Platform Mobile AppsBuilding Cross-Platform Mobile Apps
Building Cross-Platform Mobile AppsTroy Miles
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopmentgillygize
 
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.FormsVicente Gerardo Guzman Lucio
 
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 developmentSynapseindiappsdevelopment
 
Visual Studio 2017 Launch Event
Visual Studio 2017 Launch EventVisual Studio 2017 Launch Event
Visual Studio 2017 Launch EventJames Montemagno
 
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 - textToma Velev
 
Visual Studio for Mac (AltConf 2017)
Visual Studio for Mac (AltConf 2017)Visual Studio for Mac (AltConf 2017)
Visual Studio for Mac (AltConf 2017)Craig Dunn
 
Cross-platform mobile dev with Mono
Cross-platform mobile dev with MonoCross-platform mobile dev with Mono
Cross-platform mobile dev with MonoCraig Dunn
 
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 reviewUday Kothari
 
Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015Nilay Binjola
 
Angularjs Tutorial for Beginners
Angularjs Tutorial for BeginnersAngularjs Tutorial for Beginners
Angularjs Tutorial for Beginnersrajkamaltibacademy
 
Tutorial: Develop Mobile Applications with AngularJS
Tutorial: Develop Mobile Applications with AngularJSTutorial: Develop Mobile Applications with AngularJS
Tutorial: Develop Mobile Applications with AngularJSPhilipp Burgmer
 
Cloud development technology sharing (BlueMix premier)
Cloud development technology sharing (BlueMix premier)Cloud development technology sharing (BlueMix premier)
Cloud development technology sharing (BlueMix premier)æčŻç±łćł Tommy Wu
 
Droidcon uk2012 androvm
Droidcon uk2012 androvmDroidcon uk2012 androvm
Droidcon uk2012 androvmdfages
 
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)Mark Radacz
 

Ähnlich wie 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)
 

Mehr von bryan costanich

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 + xamarinbryan costanich
 
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 + xamarinbryan costanich
 
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...bryan costanich
 
Futures in Computing
Futures in Computing Futures in Computing
Futures in Computing bryan costanich
 
Advanced android app lifecycle + Patterns
Advanced android app lifecycle + PatternsAdvanced android app lifecycle + Patterns
Advanced android app lifecycle + Patternsbryan costanich
 
Cross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with XamarinCross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with Xamarinbryan 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 Studentsbryan costanich
 
Cross Platform Development with Xamarin
Cross Platform Development with XamarinCross Platform Development with Xamarin
Cross Platform Development with Xamarinbryan costanich
 

Mehr von 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
 

KĂŒrzlich hochgeladen

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
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.pdfsudhanshuwaghmare1
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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 Scriptwesley chun
 
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?Igalia
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

KĂŒrzlich hochgeladen (20)

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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, ...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
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?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

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

Hinweis der Redaktion

  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