SlideShare a Scribd company logo
Cross platform development
with C#
By Michele Scandura
Michele Scandura

Senior Software Developer at Compass Informatics (www.compass.ie)


EMAIL
michele.scandura@outlook.com


TWITTER
@mikescandy




BLOG
???
But… HTML5?

“I think the biggest mistake that we made as a company is
     betting too much on HTML5 as opposed to native”
                (Mark Zuckerberg, Sept. 2012)

 HTML5 is indeed a great technology and is here to stay
 Promise: write once, run everywhere
 JavaScript engines are getting faster, and you can use JavaScript
  on client and server
 But…
But… HTML5?


 You have to program in JavaScript 
 Write once, deploy everywhere not 100% true
 UI paradigms are different on each platform
 No access to native libraries
But… HTML5?




     iOS      Android   Windows Phone
C# as a multiplatform alternative

                                   Plus a few nice additions
 Mono makes it possible to run
  C# code on the most                Playstation Mobile (PS VITA)
  widespread platforms               The Unity 3d Engine uses C# as a
   All Windows variants              scripting language (and Unity runs
                                      on Wii and WiiU, PS3, XBOX, Flash)
   Linux
                                     PS4 will definitely run C# code
   OSX
                                     BSD, Solaris, Wii, PS3
   iOS
                                     CPU architecture is not an issue:
   Android                           x86, x64, IA64, PowerPC, SPARC,
                                      ARM…
Advantages in using C#

 Linq / Lamda, Parallel Linq, Tasks
 Memory management (no pointers, but leaks are still a problem)
 Strongly typed implicit variable declaration
 Extension methods
 Strongly typed
 Generics
 WCF
 Async/await
 (This applies only if using Visual Studio) ReSharper
C# as a multiplatform alternative



 “Between Windows, iOS and Android, your C# code can
             run on over 2.2 billion devices”
       Nat Friedman (CEO of Xamarin, Jan 2013)
Introducing Xamarin

 Newly released tools: Xamarin Studio,
  Xamarin.Android and Xamarin.iOS (formerly
  Mono for Android and MonoTouch
 Provide full access to platform SDK
 100% native
 Faster than native! (Mono vs. Dalvik,
  xobotos)
 Always in sync with native SDKs
 (iOS 6.1 released 28/1, MonoTouch update
 released the next day)
Reusable code


 Most non-UI code can be shared across platforms
   Core logic
   Entities, messages, interfaces
   Linq
   Network access


 File / Database access might be tricky
Reusable code: how to


 File linking
 Abstraction
 Observer pattern
 Partial classes
 Conditional compilation
 Portable class libraries
Useful C# libraries

 TinyIoC / TinyMessenger
 WaveEngine
 MonoGame (XNA)            We have IoC containers,
 EmguCv (open CV)          MVVM, 2D and 3D game
 NetTopologySuite          engines, ORM, Image
 MVVMCross                 processing library, Logging,
                            Web services, GIS tools…
 SQLite-Net
 ServiceStack
 Log4Net
 Many more
And native too


 Google Maps API V2
 Flurry
 OxyPlot.2DGraphLib
 Chipmunk Physics
 And many more
Tips and tricks


 Developing for iOS requires a Mac
 Emulators are good but:
     iOS provides an x86 simulator
     Android provides both ARM and x86 emulators
 iOS deployment still requires the usual certificates and some Xcode
 Memory leaks
 Git support in TFS / Xamarin Studio
Demo time (sort of!)
Conclusions


 It all sounds great, isn’t it?
 Sometimes is not straightforward as it seems
 Relying on semi-closed platform
 Specific platform knowledge is still a must: get ready to learn some
  Java and objective-c
 Mobile is not only coding, UI and UX are crucial for a successful app
Some links

Apache Cordova - http://cordova.apache.org/
Xamarin - http://xamarin.com/
iOS Dev Center - https://developer.apple.com/devcenter/ios/index.action
Android Developer - http://developer.android.com/index.html
Xamarin on GitHub - https://github.com/xamarin
The Mono Project - http://www.mono-project.com/Main_Page
TinyIoC - https://github.com/grumpydev/TinyIoC
TinyMessenger - https://github.com/grumpydev/TinyMessenger
WaveEngine - http://www.waveengine.net/
MonoGame (XNA) - http://monogame.net/
EmguCv (open CV) - http://www.emgu.com/wiki/index.php/Main_Page
NetTopologySuite - http://code.google.com/p/nettopologysuite/
MVVMCross - https://github.com/slodge/MvvmCross
SQLite-Net - https://github.com/praeclarum/sqlite-net
ServiceStack - http://www.servicestack.net/
Xamarin.iOS Bindings - https://github.com/mono/monotouch-bindings
OxyPlot.2DGraphLib - https://github.com/Emasoft/OxyPlot.2DGraphLib.MonoTouch
ShinobiControls - http://blog.xamarin.com/shinobicontrols-joins-the-xamarin-component-store-and-
evolve-speaker-lineup/

More Related Content

What's hot (20)

PPT
Cross Platform Mobile Development with Xamarin
bryan costanich
 
PPTX
C++ in Windows Phone Apps - Overview
Mirco Vanini
 
PPTX
Deep Dive into WinRT
Sasha Goldshtein
 
PPTX
C++ in windows phone apps
Mirco Vanini
 
RTF
New rich text document
AA Coaching Academy
 
PDF
Visual Studio for Mac (AltConf 2017)
Craig Dunn
 
PPSX
Imaginecup
Chiheb Chebbi
 
PDF
Flutter Tutorial For Beginners | Edureka
Edureka!
 
PPTX
Compilation Of C/C++ program in Android
rahulverma1080
 
PPTX
Xamarin Best Cross Platform Mobile App Development Solution
Ramin mohmaad hoseini
 
PDF
Software Developer's Journal - 02/2012
Ricardo Peres
 
PPT
Cross-platform mobile dev with Mono
Craig Dunn
 
PPTX
Building cross-platform mobile apps with Xamarin
Hajan Selmani
 
PPTX
Windows Phone Apps Development overview
Pruthvi Reddy
 
PDF
Flutter study jam 2019
Ahmed Abu Eldahab
 
PPTX
Best Platforms For Mobile App Development
Magneto IT Solutions
 
PPT
Silverlight 2 with Visual Studio 2008 and Expression Blend
Caleb Jenkins
 
PPTX
Programming With WinRT And Windows8
Rainer Stropek
 
PPTX
Programming languages
Tammy London
 
PPTX
Windows 10 & Raspberry Pi 2
ByteMinded
 
Cross Platform Mobile Development with Xamarin
bryan costanich
 
C++ in Windows Phone Apps - Overview
Mirco Vanini
 
Deep Dive into WinRT
Sasha Goldshtein
 
C++ in windows phone apps
Mirco Vanini
 
New rich text document
AA Coaching Academy
 
Visual Studio for Mac (AltConf 2017)
Craig Dunn
 
Imaginecup
Chiheb Chebbi
 
Flutter Tutorial For Beginners | Edureka
Edureka!
 
Compilation Of C/C++ program in Android
rahulverma1080
 
Xamarin Best Cross Platform Mobile App Development Solution
Ramin mohmaad hoseini
 
Software Developer's Journal - 02/2012
Ricardo Peres
 
Cross-platform mobile dev with Mono
Craig Dunn
 
Building cross-platform mobile apps with Xamarin
Hajan Selmani
 
Windows Phone Apps Development overview
Pruthvi Reddy
 
Flutter study jam 2019
Ahmed Abu Eldahab
 
Best Platforms For Mobile App Development
Magneto IT Solutions
 
Silverlight 2 with Visual Studio 2008 and Expression Blend
Caleb Jenkins
 
Programming With WinRT And Windows8
Rainer Stropek
 
Programming languages
Tammy London
 
Windows 10 & Raspberry Pi 2
ByteMinded
 

Similar to Cross platform development with C# (20)

PDF
Minko - Creating cross-platform 3D apps with Minko
Minko3D
 
PDF
Paris Android LiveCode - Creating cross-platform 3D apps with Minko
Minko3D
 
PDF
WebGL games with Minko - Next Game Frontier 2014
Minko3D
 
PPT
Open Kode, Airplay And The New Reality Of Write Once Run Anywhere
guest991eb3
 
PDF
Apps vs. Sites vs. Content - a vendor-agnostic view on building stuff for the...
Kai Koenig
 
PDF
Introduccion Xamarin Open Closed
Ivan Martinez
 
PPTX
Sviluppo x platform con xamarin
Dan Ardelean
 
PPT
Casual Engines 2009
David Fox
 
PDF
Top 10 Essential Technologies For Every Full Stack .NET Developer!
Aspire Techsoft Academy
 
PPTX
Mobile Development with Visual Studio by Sergey Seletsky
SoftServe
 
PPTX
Presentation1
kpkcsc
 
PPTX
Mobile development with visual studio
Sergey Seletsky
 
PDF
Native iOS and Android Development with Xamarin
James Montemagno
 
PPTX
Dev days 1 Introduction to Xamarin Taswar Bhatti
Taswar Bhatti
 
PDF
Flutter vs. MAUI - Techorama BE 2022
Tobias Hoppenthaler
 
PPTX
Advantages and Opportunities of Cross-Platform Development
Jochen Kirstätter
 
PDF
TK2323 Lecture 1 - Introduction to Mobile Application.pdf
Lam Chun
 
PPTX
Cross Platform Mobile Development with Visual Studio 2015 and C++
Richard Thomson
 
PDF
Dot Net Project Mini Game
varun arora
 
PDF
Xcoders - iOS & Android Development in C# with Xamarin
James Montemagno
 
Minko - Creating cross-platform 3D apps with Minko
Minko3D
 
Paris Android LiveCode - Creating cross-platform 3D apps with Minko
Minko3D
 
WebGL games with Minko - Next Game Frontier 2014
Minko3D
 
Open Kode, Airplay And The New Reality Of Write Once Run Anywhere
guest991eb3
 
Apps vs. Sites vs. Content - a vendor-agnostic view on building stuff for the...
Kai Koenig
 
Introduccion Xamarin Open Closed
Ivan Martinez
 
Sviluppo x platform con xamarin
Dan Ardelean
 
Casual Engines 2009
David Fox
 
Top 10 Essential Technologies For Every Full Stack .NET Developer!
Aspire Techsoft Academy
 
Mobile Development with Visual Studio by Sergey Seletsky
SoftServe
 
Presentation1
kpkcsc
 
Mobile development with visual studio
Sergey Seletsky
 
Native iOS and Android Development with Xamarin
James Montemagno
 
Dev days 1 Introduction to Xamarin Taswar Bhatti
Taswar Bhatti
 
Flutter vs. MAUI - Techorama BE 2022
Tobias Hoppenthaler
 
Advantages and Opportunities of Cross-Platform Development
Jochen Kirstätter
 
TK2323 Lecture 1 - Introduction to Mobile Application.pdf
Lam Chun
 
Cross Platform Mobile Development with Visual Studio 2015 and C++
Richard Thomson
 
Dot Net Project Mini Game
varun arora
 
Xcoders - iOS & Android Development in C# with Xamarin
James Montemagno
 
Ad

Cross platform development with C#

  • 1. Cross platform development with C# By Michele Scandura
  • 2. Michele Scandura Senior Software Developer at Compass Informatics (www.compass.ie) EMAIL [email protected] TWITTER @mikescandy BLOG ???
  • 3. But… HTML5? “I think the biggest mistake that we made as a company is betting too much on HTML5 as opposed to native” (Mark Zuckerberg, Sept. 2012)  HTML5 is indeed a great technology and is here to stay  Promise: write once, run everywhere  JavaScript engines are getting faster, and you can use JavaScript on client and server  But…
  • 4. But… HTML5?  You have to program in JavaScript   Write once, deploy everywhere not 100% true  UI paradigms are different on each platform  No access to native libraries
  • 5. But… HTML5? iOS Android Windows Phone
  • 6. C# as a multiplatform alternative  Plus a few nice additions  Mono makes it possible to run C# code on the most Playstation Mobile (PS VITA) widespread platforms The Unity 3d Engine uses C# as a All Windows variants scripting language (and Unity runs on Wii and WiiU, PS3, XBOX, Flash) Linux PS4 will definitely run C# code OSX BSD, Solaris, Wii, PS3 iOS CPU architecture is not an issue: Android x86, x64, IA64, PowerPC, SPARC, ARM…
  • 7. Advantages in using C#  Linq / Lamda, Parallel Linq, Tasks  Memory management (no pointers, but leaks are still a problem)  Strongly typed implicit variable declaration  Extension methods  Strongly typed  Generics  WCF  Async/await  (This applies only if using Visual Studio) ReSharper
  • 8. C# as a multiplatform alternative “Between Windows, iOS and Android, your C# code can run on over 2.2 billion devices” Nat Friedman (CEO of Xamarin, Jan 2013)
  • 9. Introducing Xamarin  Newly released tools: Xamarin Studio, Xamarin.Android and Xamarin.iOS (formerly Mono for Android and MonoTouch  Provide full access to platform SDK  100% native  Faster than native! (Mono vs. Dalvik, xobotos)  Always in sync with native SDKs  (iOS 6.1 released 28/1, MonoTouch update released the next day)
  • 10. Reusable code  Most non-UI code can be shared across platforms Core logic Entities, messages, interfaces Linq Network access  File / Database access might be tricky
  • 11. Reusable code: how to  File linking  Abstraction  Observer pattern  Partial classes  Conditional compilation  Portable class libraries
  • 12. Useful C# libraries  TinyIoC / TinyMessenger  WaveEngine  MonoGame (XNA) We have IoC containers,  EmguCv (open CV) MVVM, 2D and 3D game  NetTopologySuite engines, ORM, Image  MVVMCross processing library, Logging, Web services, GIS tools…  SQLite-Net  ServiceStack  Log4Net  Many more
  • 13. And native too  Google Maps API V2  Flurry  OxyPlot.2DGraphLib  Chipmunk Physics  And many more
  • 14. Tips and tricks  Developing for iOS requires a Mac  Emulators are good but:  iOS provides an x86 simulator  Android provides both ARM and x86 emulators  iOS deployment still requires the usual certificates and some Xcode  Memory leaks  Git support in TFS / Xamarin Studio
  • 16. Conclusions  It all sounds great, isn’t it?  Sometimes is not straightforward as it seems  Relying on semi-closed platform  Specific platform knowledge is still a must: get ready to learn some Java and objective-c  Mobile is not only coding, UI and UX are crucial for a successful app
  • 17. Some links Apache Cordova - http://cordova.apache.org/ Xamarin - http://xamarin.com/ iOS Dev Center - https://developer.apple.com/devcenter/ios/index.action Android Developer - http://developer.android.com/index.html Xamarin on GitHub - https://github.com/xamarin The Mono Project - http://www.mono-project.com/Main_Page TinyIoC - https://github.com/grumpydev/TinyIoC TinyMessenger - https://github.com/grumpydev/TinyMessenger WaveEngine - http://www.waveengine.net/ MonoGame (XNA) - http://monogame.net/ EmguCv (open CV) - http://www.emgu.com/wiki/index.php/Main_Page NetTopologySuite - http://code.google.com/p/nettopologysuite/ MVVMCross - https://github.com/slodge/MvvmCross SQLite-Net - https://github.com/praeclarum/sqlite-net ServiceStack - http://www.servicestack.net/ Xamarin.iOS Bindings - https://github.com/mono/monotouch-bindings OxyPlot.2DGraphLib - https://github.com/Emasoft/OxyPlot.2DGraphLib.MonoTouch ShinobiControls - http://blog.xamarin.com/shinobicontrols-joins-the-xamarin-component-store-and- evolve-speaker-lineup/