SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Cross platform mobile development
with Visual Studio and Xamarin:
Architecture and code reuse
Ibon Landa
Plain Concepts



Native Development
iOS
Objective C
Xcode
Windows Phone
C#/Visual
Basic/F#
Visual Studio
Android
Java
Eclipse
IntelliJ
Using the platform native tools
Xcode ADT Visual
Studio
+
+
-
✗
Build and debug iOS applications on a Windows computer using the Visual Studio
IDE
Windows
Windows 7 or higher.
Visual Studio 2010 Professional or higher.
Xamarin’s plug-in for Visual Studio.
MAC
A Macintosh running OS X Lion or higher (although we recommend the latest
version).
Xamarin iOS SDK.
Apple’s Xcode IDE and iOS SDK (we recommend the latest version from the
App Store).
Xamarin.iOS on Windows
Xamarin.iOS on Windows
Use PCLs
Use View Models to reuse presentation code
Heavy use of dependency injection
Allows different implementations for different platforms
Improving Code Reuse in 3 easy ways
Create a single library that can be
used by multiple .net frameworks
Allows access only to functionality
shared by all selected frameworks
Does some nifty namespace
mapping
Makes cross platform development
much easier
Microsoft and 3rd party PCLs
available (HttpClient, Imaging,
JSON…)
Portable Class Libraries
Shared Core
Maximizing code reuse
How to display information
What information to display
Flow of interaction
Data objects
Business logic
Etc.
Model
View Model
View Device-specific
Portable codeReferences
Databinds
UI
Application Logic
Out of the box approach
View
ViewModel
Model
Model-View-ViewModel (MVVM)
Cross Platform MVVM Development Framework
Free, open source
Supports
WP7,8
WPF
WinRT
Xamarin.Android
Xamarin.iOS
Xamarin.Mac
AKA Mvx
MvvmCross
XAML Code
<StackPanel>
<TextBox Text="{Binding Hello, Mode=TwoWay}" />
<TextBlock Text="{Binding Hello}" />
<Button Content="Click Me" Command="{Binding MyCommand}" />
<Button Content="Go Second"
Command="{Binding GoSecondCommand}"
/>
</StackPanel>
public class FirstViewModel : MvxViewModel
{
private string _hello = "Hello MvvmCross";
public string Hello
{
get { return _hello; }
set { _hello = value; RaisePropertyChanged(() => Hello); }
}
public System.Windows.Input.ICommand MyCommand
{
get
{
return new Cirrious.MvvmCross.ViewModels.MvxCommand(DoMyCommand);
}
}
private void DoMyCommand()
{
Hello = Hello + " World";
}
public System.Windows.Input.ICommand GoSecondCommand
{
get
{
return new Cirrious.MvvmCross.ViewModels.MvxCommand(DoGoSecond);
}
}
private void DoGoSecond()
{
ShowViewModel<SecondViewModel>();
}
}
MvvmCross Architecture
Convenient way to access platform functionality
Use NinjaCoder or Nuget to add plugins
Includes Accelerometer, Email, Files, Location, Messaging, Sqlite
3rd party plugins available as well.
Consume plugins using Dependency Injection or Service locator
MvvmCross Plugins
Describe functionality using an interface in .Core
Create platform specific implementation in .xxxx
Register implementation on app startup
Mvx.RegisterSingleton<ISettingsPersistance>(new SettingsPersistanceWPF());
Mvx.RegisterType<IGetRemoteData, RemoteDataWpf>();
Consume plugins using Dependancy Injection or Service locator
persistance = Mvx.Resolve<ISettingsPersistance>();
Platform specific code
Architecture overview
PCLs let you use easily share code across multiple platforms
Xamarin lets you use C# on Android, iOS and Mac
MvvmCross wraps it all up to make it easy
Shared PCL that holds most functionality
Platform specific apps for views and dependant code
Plugins let you easily add functionality in a cross platform friendly way
Do your own platform dependant stuff using interfaces and
IoC/Dependancy Injection
Summary
Thanks!

Más contenido relacionado

Similar a Cross platform mobile development with visual studio and xamarin

Deeper into Windows 10 Development
Deeper into Windows 10 DevelopmentDeeper into Windows 10 Development
Deeper into Windows 10 DevelopmentShahed Chowdhuri
 
Customizing Xamarin.Forms UI
Customizing Xamarin.Forms UICustomizing Xamarin.Forms UI
Customizing Xamarin.Forms UIXamarin
 
Writing native Mac apps in C# with Xamarin.Mac - Aaron Bockover
Writing native Mac apps in C# with Xamarin.Mac - Aaron BockoverWriting native Mac apps in C# with Xamarin.Mac - Aaron Bockover
Writing native Mac apps in C# with Xamarin.Mac - Aaron BockoverXamarin
 
Going Desktop with Electron
Going Desktop with ElectronGoing Desktop with Electron
Going Desktop with ElectronLeo Lindhorst
 
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ....NET Conf UY
 
Basic Intro to android(Will be updating later)
Basic Intro to android(Will be updating later)Basic Intro to android(Will be updating later)
Basic Intro to android(Will be updating later)Sanju Sony Kurian
 
Lesson 02 - React Native Development Environment Setup
Lesson 02 - React Native Development Environment SetupLesson 02 - React Native Development Environment Setup
Lesson 02 - React Native Development Environment SetupUniversity of Catania
 
Electron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyElectron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyUlrich Krause
 
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows AzureDeveloping Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows AzureRainer Stropek
 
Your First Xamarin.Forms App
Your First Xamarin.Forms AppYour First Xamarin.Forms App
Your First Xamarin.Forms AppCraig Dunn
 
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with VoltaDaniel Fisher
 
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
 
Use html5 to build what you want, where you want it
Use html5 to build what you want, where you want itUse html5 to build what you want, where you want it
Use html5 to build what you want, where you want itKevin DeRudder
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsMatteo Manchi
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache CordovaHazem Saleh
 
Real world apps with Xamarin and MVVM
Real world apps with Xamarin and MVVMReal world apps with Xamarin and MVVM
Real world apps with Xamarin and MVVMGill Cleeren
 
Android/iPhone/Blackberry Web Service Connector
Android/iPhone/Blackberry Web Service ConnectorAndroid/iPhone/Blackberry Web Service Connector
Android/iPhone/Blackberry Web Service ConnectorAkash Kava
 

Similar a Cross platform mobile development with visual studio and xamarin (20)

Lightning Talk - Xamarin
Lightning Talk - Xamarin Lightning Talk - Xamarin
Lightning Talk - Xamarin
 
Deeper into Windows 10 Development
Deeper into Windows 10 DevelopmentDeeper into Windows 10 Development
Deeper into Windows 10 Development
 
Customizing Xamarin.Forms UI
Customizing Xamarin.Forms UICustomizing Xamarin.Forms UI
Customizing Xamarin.Forms UI
 
Writing native Mac apps in C# with Xamarin.Mac - Aaron Bockover
Writing native Mac apps in C# with Xamarin.Mac - Aaron BockoverWriting native Mac apps in C# with Xamarin.Mac - Aaron Bockover
Writing native Mac apps in C# with Xamarin.Mac - Aaron Bockover
 
Going Desktop with Electron
Going Desktop with ElectronGoing Desktop with Electron
Going Desktop with Electron
 
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
 
Basic Intro to android(Will be updating later)
Basic Intro to android(Will be updating later)Basic Intro to android(Will be updating later)
Basic Intro to android(Will be updating later)
 
React native by example by Vadim Ruban
React native by example by Vadim RubanReact native by example by Vadim Ruban
React native by example by Vadim Ruban
 
Lesson 02 - React Native Development Environment Setup
Lesson 02 - React Native Development Environment SetupLesson 02 - React Native Development Environment Setup
Lesson 02 - React Native Development Environment Setup
 
Electron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyElectron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easy
 
5.node js
5.node js5.node js
5.node js
 
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows AzureDeveloping Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
 
Your First Xamarin.Forms App
Your First Xamarin.Forms AppYour First Xamarin.Forms App
Your First Xamarin.Forms App
 
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta
 
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
 
Use html5 to build what you want, where you want it
Use html5 to build what you want, where you want itUse html5 to build what you want, where you want it
Use html5 to build what you want, where you want it
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
 
Real world apps with Xamarin and MVVM
Real world apps with Xamarin and MVVMReal world apps with Xamarin and MVVM
Real world apps with Xamarin and MVVM
 
Android/iPhone/Blackberry Web Service Connector
Android/iPhone/Blackberry Web Service ConnectorAndroid/iPhone/Blackberry Web Service Connector
Android/iPhone/Blackberry Web Service Connector
 

Más de Ibon Landa

Aprovisionamiento y configuración deVMs con Azure Resource Manager
Aprovisionamiento y configuración deVMs con Azure Resource ManagerAprovisionamiento y configuración deVMs con Azure Resource Manager
Aprovisionamiento y configuración deVMs con Azure Resource ManagerIbon Landa
 
Building real world cloud apps with azure
Building real world cloud apps with azureBuilding real world cloud apps with azure
Building real world cloud apps with azureIbon Landa
 
Open source and cross platform .net
Open source and cross platform .netOpen source and cross platform .net
Open source and cross platform .netIbon Landa
 
Dev ops: Continuous delivery and Windows Azure
Dev ops: Continuous delivery and Windows AzureDev ops: Continuous delivery and Windows Azure
Dev ops: Continuous delivery and Windows AzureIbon Landa
 
Gestión de identidad en aplicaciones corporativas web y móvil
Gestión de identidad en aplicaciones corporativas web y móvilGestión de identidad en aplicaciones corporativas web y móvil
Gestión de identidad en aplicaciones corporativas web y móvilIbon Landa
 
Arquitectura y Buenas prácticas con Windows Azure para ITPros
Arquitectura y Buenas prácticas con Windows Azure para ITProsArquitectura y Buenas prácticas con Windows Azure para ITPros
Arquitectura y Buenas prácticas con Windows Azure para ITProsIbon Landa
 
Arquitecturas y posicionamientos tecnológicos
Arquitecturas y posicionamientos tecnológicosArquitecturas y posicionamientos tecnológicos
Arquitecturas y posicionamientos tecnológicosIbon Landa
 
Gestión de identidad en Cloud
Gestión de identidad en CloudGestión de identidad en Cloud
Gestión de identidad en CloudIbon Landa
 
Scrum en equipos multiproyectos
Scrum en equipos multiproyectosScrum en equipos multiproyectos
Scrum en equipos multiproyectosIbon Landa
 
Montando un escenario de integración continua - Pucela Tech Day
Montando un escenario de integración continua - Pucela Tech DayMontando un escenario de integración continua - Pucela Tech Day
Montando un escenario de integración continua - Pucela Tech DayIbon Landa
 
Windows azure connect copy
Windows azure connect   copyWindows azure connect   copy
Windows azure connect copyIbon Landa
 
Windows Azure Connect
Windows Azure ConnectWindows Azure Connect
Windows Azure ConnectIbon Landa
 
Integración de Team Foundation Server con Project Server
Integración de Team Foundation Server con Project ServerIntegración de Team Foundation Server con Project Server
Integración de Team Foundation Server con Project ServerIbon Landa
 

Más de Ibon Landa (13)

Aprovisionamiento y configuración deVMs con Azure Resource Manager
Aprovisionamiento y configuración deVMs con Azure Resource ManagerAprovisionamiento y configuración deVMs con Azure Resource Manager
Aprovisionamiento y configuración deVMs con Azure Resource Manager
 
Building real world cloud apps with azure
Building real world cloud apps with azureBuilding real world cloud apps with azure
Building real world cloud apps with azure
 
Open source and cross platform .net
Open source and cross platform .netOpen source and cross platform .net
Open source and cross platform .net
 
Dev ops: Continuous delivery and Windows Azure
Dev ops: Continuous delivery and Windows AzureDev ops: Continuous delivery and Windows Azure
Dev ops: Continuous delivery and Windows Azure
 
Gestión de identidad en aplicaciones corporativas web y móvil
Gestión de identidad en aplicaciones corporativas web y móvilGestión de identidad en aplicaciones corporativas web y móvil
Gestión de identidad en aplicaciones corporativas web y móvil
 
Arquitectura y Buenas prácticas con Windows Azure para ITPros
Arquitectura y Buenas prácticas con Windows Azure para ITProsArquitectura y Buenas prácticas con Windows Azure para ITPros
Arquitectura y Buenas prácticas con Windows Azure para ITPros
 
Arquitecturas y posicionamientos tecnológicos
Arquitecturas y posicionamientos tecnológicosArquitecturas y posicionamientos tecnológicos
Arquitecturas y posicionamientos tecnológicos
 
Gestión de identidad en Cloud
Gestión de identidad en CloudGestión de identidad en Cloud
Gestión de identidad en Cloud
 
Scrum en equipos multiproyectos
Scrum en equipos multiproyectosScrum en equipos multiproyectos
Scrum en equipos multiproyectos
 
Montando un escenario de integración continua - Pucela Tech Day
Montando un escenario de integración continua - Pucela Tech DayMontando un escenario de integración continua - Pucela Tech Day
Montando un escenario de integración continua - Pucela Tech Day
 
Windows azure connect copy
Windows azure connect   copyWindows azure connect   copy
Windows azure connect copy
 
Windows Azure Connect
Windows Azure ConnectWindows Azure Connect
Windows Azure Connect
 
Integración de Team Foundation Server con Project Server
Integración de Team Foundation Server con Project ServerIntegración de Team Foundation Server con Project Server
Integración de Team Foundation Server con Project Server
 

Último

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
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
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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...Miguel Araújo
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Último (20)

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
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...
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

Cross platform mobile development with visual studio and xamarin

  • 1. Cross platform mobile development with Visual Studio and Xamarin: Architecture and code reuse Ibon Landa Plain Concepts
  • 2.
  • 3.
  • 5. Native Development iOS Objective C Xcode Windows Phone C#/Visual Basic/F# Visual Studio Android Java Eclipse IntelliJ
  • 6. Using the platform native tools Xcode ADT Visual Studio + + - ✗
  • 7.
  • 8.
  • 9. Build and debug iOS applications on a Windows computer using the Visual Studio IDE Windows Windows 7 or higher. Visual Studio 2010 Professional or higher. Xamarin’s plug-in for Visual Studio. MAC A Macintosh running OS X Lion or higher (although we recommend the latest version). Xamarin iOS SDK. Apple’s Xcode IDE and iOS SDK (we recommend the latest version from the App Store). Xamarin.iOS on Windows
  • 11.
  • 12.
  • 13. Use PCLs Use View Models to reuse presentation code Heavy use of dependency injection Allows different implementations for different platforms Improving Code Reuse in 3 easy ways
  • 14.
  • 15. Create a single library that can be used by multiple .net frameworks Allows access only to functionality shared by all selected frameworks Does some nifty namespace mapping Makes cross platform development much easier Microsoft and 3rd party PCLs available (HttpClient, Imaging, JSON…) Portable Class Libraries
  • 17.
  • 18.
  • 19. Maximizing code reuse How to display information What information to display Flow of interaction Data objects Business logic Etc. Model View Model View Device-specific Portable codeReferences Databinds
  • 20. UI Application Logic Out of the box approach View ViewModel Model Model-View-ViewModel (MVVM)
  • 21. Cross Platform MVVM Development Framework Free, open source Supports WP7,8 WPF WinRT Xamarin.Android Xamarin.iOS Xamarin.Mac AKA Mvx MvvmCross
  • 22. XAML Code <StackPanel> <TextBox Text="{Binding Hello, Mode=TwoWay}" /> <TextBlock Text="{Binding Hello}" /> <Button Content="Click Me" Command="{Binding MyCommand}" /> <Button Content="Go Second" Command="{Binding GoSecondCommand}" /> </StackPanel> public class FirstViewModel : MvxViewModel { private string _hello = "Hello MvvmCross"; public string Hello { get { return _hello; } set { _hello = value; RaisePropertyChanged(() => Hello); } } public System.Windows.Input.ICommand MyCommand { get { return new Cirrious.MvvmCross.ViewModels.MvxCommand(DoMyCommand); } } private void DoMyCommand() { Hello = Hello + " World"; } public System.Windows.Input.ICommand GoSecondCommand { get { return new Cirrious.MvvmCross.ViewModels.MvxCommand(DoGoSecond); } } private void DoGoSecond() { ShowViewModel<SecondViewModel>(); } }
  • 24. Convenient way to access platform functionality Use NinjaCoder or Nuget to add plugins Includes Accelerometer, Email, Files, Location, Messaging, Sqlite 3rd party plugins available as well. Consume plugins using Dependency Injection or Service locator MvvmCross Plugins
  • 25.
  • 26.
  • 27. Describe functionality using an interface in .Core Create platform specific implementation in .xxxx Register implementation on app startup Mvx.RegisterSingleton<ISettingsPersistance>(new SettingsPersistanceWPF()); Mvx.RegisterType<IGetRemoteData, RemoteDataWpf>(); Consume plugins using Dependancy Injection or Service locator persistance = Mvx.Resolve<ISettingsPersistance>(); Platform specific code
  • 28.
  • 30. PCLs let you use easily share code across multiple platforms Xamarin lets you use C# on Android, iOS and Mac MvvmCross wraps it all up to make it easy Shared PCL that holds most functionality Platform specific apps for views and dependant code Plugins let you easily add functionality in a cross platform friendly way Do your own platform dependant stuff using interfaces and IoC/Dependancy Injection Summary
  • 31.
  • 32.