SlideShare a Scribd company logo
Multi-platform with Mono
 
 
iOS Basics Based on Mac OSX – so it's Unix Development is done with Objective-C No memory management (on iOS devices) Some 'different' syntax  [[Fraction alloc] init] but  readable for c# developers, particularly once you get your head around message-passing, protocols, delegates and their MVC interpretation
Android Basics Based on Linux 2.6 – so it's Unix Development is done with Java “ Every Android application runs in its own process, with its own instance of the Dalvik virtual machine” very readable for c# developers, so existing examples and documentation are accessible
What is Mono? Open source  implementation of the CLR Linux, MacOS X, Solaris, BSD, Wii, PS3 Started in 2001, purchased by Novell in 2003, released in 2004 'binary compatible' with Microsoft .NET Existing .NET assemblies will run Includes the  framework http://www.mono-project.com/   http://github.com/mono
What is MonoTouch? Mono ('Silverlight subset') + iOS API bindings  + Xcode/Interface Builder parser  + Static (AOT) compiler  = Native iPhone/iPad application http://monotouch.net/   Released Sept 2009
MonoTouch System Req's To play in the simulator ( FREE ) Intel-based Mac OSX (latest : Snow Leopard) Apple's iPhone SDK (Simulator)  ^ Mono for OSX MonoTouch Trial (and MonoDevelop IDE)  ^ To get onto your iPhone/iPad (and into the AppStore) Apple Developer Program membership (USD99)  ^ MonoTouch Prof or Enterprise license (USD399+)
What is Mono for Android? Mono ('Silverlight subset') + Android API bindings  + 'AXML' intellisense support  + Visual Studio plug-in  (or MonoDevelop) = Android application http://mono-android.net/ Released April 2011
Mono for Android System Req's To play in the simulator ( FREE ) Mac OSX  with MonoDevelop  OR   Windows  (VisualStudio 2010 or MonoDevelop)  Oracle's Java SDK Google's Android SDK Mono for Android Trial (and MonoDevelop IDE) To get onto a device Mono for Android Prof or Enterprise license (USD399+) To get onto Android Market Google Developer account (USD25)
What is Mono for WP7?
What is Mono for WP7? Kidding! Just grab the Windows Phone 7 Developer Tools (with Visual Studio 2010 Express) and use the  real  .NET Framework :-) There will be other sessions about WP7...  just keep in mind that the non-UI code you write there can run on iOS & Android thanks to Mono :-)
Details! Debugging Linking UI iOS Android Navigation Databinding F.A.Q.
Debugging 'soft debugger' gets embedded in your app Can be configured (IP address, port) Binaries are much larger (of course) Allows breakpoints, step-through, call stack Works via TCP/IP, so you can debug the Simulator AND the device (untethered, so long as wifi is enabled).
Linking Mono compiler strips out unused classes/libraries Mobile devices – size matters! Trap for young players: it might strip out stuff you want to keep! Classes/methods/properties used via Reflection Classes/methods/properties used in serialization operations By default it's disabled in DEBUG, so stuff will work there and mysteriously break in RELEASE [ Preserve (AllMembers =  true )]
Binding to iOS Native Controls 1 MonoTouch.* namespaces 'map' to the native iPhone OS SDK 'frameworks', eg. MonoTouch.UIKit contains UITableView, UITextBox/UITextBlock, UIButton MonoTouch.MapKit contains MKMapView, MKUserLocation MonoTouch.CoreLocation CLLocationCoordinate2D etc...
Binding to iOS Native Controls 2 Layouts are generally 'absolute positioned' More like Windows Forms Views can be nested; custom views can be created You may end up 'measuring' text to get tight layouts UITableView gets used a LOT Two ways to build: Xcode / Interface Builder Programmatically  ← my preference
Interface Builder integration 1 Interface Builder is like the Visual Studio designer for ASPX and XAML – except it creates .XIB files
Interface Builder integration 2 .designer.cs behaves similarly to .NET – detects XIB changes and generates partial classes provide a hook for your GUI controls
Binding to Android Native Controls 1 Android.* namespaces 'map' to the native Android  SDK classes, eg. Android.Widget contains ListView, Button, ImageView, TextView Android.App contains Activity, Dialog, Application etc...  but some things (eg. Map) still not quite there
Binding to Android Native Controls 2 Layout is generally 'relative' More like XAML [LinearLayout ~= StackPanel] Doesn't mean things can't overlap! Custom views can be created and referenced in your axml  (namespace trick) Two ways to build: axml in the /Layout/ folder  ← my preference programmatically
Android UI Designer There isn't one!  (of the same quality. Options include DroidDraw) Resource.Designer.cs Intellisense for UI elements (from .axml to c#) .axml is used to enable intellisense NOT  a full partial-class linking axml-Activity * FindViewById<T> is used to wire up yourself * http://betasoftware.blogspot.com/2011/02/automated-monodroid-layout-t4-edition.html
Navigation Getting from screen to screen StartActivity() Intent SetClass typeof(AnActivity) PutExtra Can also 'trigger' other applications PushViewController() UIViewController Subclass and pass instance …  also UITabBar items
Databinding (lists) More work that you are used to... BaseAdapter GetView Count GetItem (.ItemClick is attached to the ListView itself) UITableViewSource GetCell RowsInSection RowSelected
'translation'
F.A.Q. Questions I've been asked in the past: Filesystem Settings Sqlite WebClient Incoming connections Interfacing with the device (call, gps, camera)
Example: RestGuide Runs on Android, iOS and Windows Phone 7 github.com/conceptdev
Example: MIX11 Runs on Android, iOS and Windows Phone 7 mix11.confapp.com
Any questions?
Professional iPhone w/ MonoTouch

More Related Content

PDF
Mono for Android... for Google Devs
Craig Dunn
 
PPT
OzAltNet Fast-ANDroid-furious
Craig Dunn
 
ODP
OzAltNet Fast-ANDroid-furious
Craig Dunn
 
PDF
Where Do I Click
bredex
 
PDF
React-Native-N3XTCODER-Arya-Workshop-April-2016
N3XTCODER
 
PPTX
Cloudcomputingday2
Edward Iglesias
 
PDF
#Code2Create:: Introduction to App Development in Flutter with Dart
GDGKuwaitGoogleDevel
 
ODP
Plug yourself in and your app will never be the same (2 hour edition)
Mikkel Flindt Heisterberg
 
Mono for Android... for Google Devs
Craig Dunn
 
OzAltNet Fast-ANDroid-furious
Craig Dunn
 
OzAltNet Fast-ANDroid-furious
Craig Dunn
 
Where Do I Click
bredex
 
React-Native-N3XTCODER-Arya-Workshop-April-2016
N3XTCODER
 
Cloudcomputingday2
Edward Iglesias
 
#Code2Create:: Introduction to App Development in Flutter with Dart
GDGKuwaitGoogleDevel
 
Plug yourself in and your app will never be the same (2 hour edition)
Mikkel Flindt Heisterberg
 

Similar to Cross-platform mobile dev with Mono (20)

PDF
Introduction to MonoTouch and Monodroid/Mono for Android
Chris Hardy
 
PPTX
EastBay.NET - Introduction to MonoTouch
mobiweave
 
KEY
C# on the iPhone with MonoTouch Glasgow
Chris Hardy
 
PPTX
Learning C# iPad Programming
Rich Helton
 
PDF
C# On The iPhone with MonoTouch at DDD8
Chris Hardy
 
PDF
WP7, Droid, iPhone, Oh my!
Chris Hardy
 
PPTX
Introduction to MonoTouch
mobiweave
 
PDF
Italian Alt.Net Conference MonoTouch Session
Chris Hardy
 
PPTX
.NET? MonoDroid Does
Kevin McMahon
 
PPTX
Introduction to MonoTouch
Jonas Follesø
 
PPTX
Building cross-platform mobile apps with Xamarin
Hajan Selmani
 
KEY
Getting Started Using MonoTouch
Xamarin
 
PDF
Monotouch iPhone Development – IGDA Orlando - 2007
Adam Hill
 
KEY
Intro to iPhone Development with MonoTouch
Michael Koby
 
PDF
Mono for .NET Developers
jeffz
 
PDF
Xamarin for (not only) Android developers
Aleksander Piotrowski
 
PPTX
A lap around monotouch
mecurioJ
 
PDF
C# everywhere
Craig Dunn
 
PPTX
I Like iPhone & Android But I am .NET Developer
Tellago
 
PDF
Introduction to Cross Platform Development with Xamarin/ Visual Studio
IndyMobileNetDev
 
Introduction to MonoTouch and Monodroid/Mono for Android
Chris Hardy
 
EastBay.NET - Introduction to MonoTouch
mobiweave
 
C# on the iPhone with MonoTouch Glasgow
Chris Hardy
 
Learning C# iPad Programming
Rich Helton
 
C# On The iPhone with MonoTouch at DDD8
Chris Hardy
 
WP7, Droid, iPhone, Oh my!
Chris Hardy
 
Introduction to MonoTouch
mobiweave
 
Italian Alt.Net Conference MonoTouch Session
Chris Hardy
 
.NET? MonoDroid Does
Kevin McMahon
 
Introduction to MonoTouch
Jonas Follesø
 
Building cross-platform mobile apps with Xamarin
Hajan Selmani
 
Getting Started Using MonoTouch
Xamarin
 
Monotouch iPhone Development – IGDA Orlando - 2007
Adam Hill
 
Intro to iPhone Development with MonoTouch
Michael Koby
 
Mono for .NET Developers
jeffz
 
Xamarin for (not only) Android developers
Aleksander Piotrowski
 
A lap around monotouch
mecurioJ
 
C# everywhere
Craig Dunn
 
I Like iPhone & Android But I am .NET Developer
Tellago
 
Introduction to Cross Platform Development with Xamarin/ Visual Studio
IndyMobileNetDev
 
Ad

More from Craig Dunn (18)

PDF
Visual Studio for Mac (AltConf 2017)
Craig Dunn
 
PDF
EastBay.net Building Mobile Apps with Xamarin and Visual Studio
Craig Dunn
 
PDF
Introduction to iOS 9 (Xamarin Evolve 2016)
Craig Dunn
 
PPTX
Xamarin for iOS developers
Craig Dunn
 
PPTX
Introduction to Xamarin.Forms 2.x
Craig Dunn
 
PDF
Xamarin DevDays Portland - iOS 9
Craig Dunn
 
PDF
Wearables with C# and Xamarin
Craig Dunn
 
PPTX
What's New Xamarin.Forms 1.3
Craig Dunn
 
PDF
Your First Xamarin.Forms App
Craig Dunn
 
PDF
Introduction to iOS with C# using Xamarin
Craig Dunn
 
PDF
Introduction to Android with C# using Xamarin
Craig Dunn
 
PDF
iOS & Android apps using Parse and Xamarin
Craig Dunn
 
PDF
Azure Mobile Services - more than just cloud data
Craig Dunn
 
PDF
Cloud-enabling iOS & Android apps with C# (using Xamarin)
Craig Dunn
 
PDF
Cloudy with a Chance of Cross Platform (for Bay.NET)
Craig Dunn
 
PDF
Async Await for Mobile Apps
Craig Dunn
 
PDF
Xamarin v.Now
Craig Dunn
 
KEY
PassKit on iOS6
Craig Dunn
 
Visual Studio for Mac (AltConf 2017)
Craig Dunn
 
EastBay.net Building Mobile Apps with Xamarin and Visual Studio
Craig Dunn
 
Introduction to iOS 9 (Xamarin Evolve 2016)
Craig Dunn
 
Xamarin for iOS developers
Craig Dunn
 
Introduction to Xamarin.Forms 2.x
Craig Dunn
 
Xamarin DevDays Portland - iOS 9
Craig Dunn
 
Wearables with C# and Xamarin
Craig Dunn
 
What's New Xamarin.Forms 1.3
Craig Dunn
 
Your First Xamarin.Forms App
Craig Dunn
 
Introduction to iOS with C# using Xamarin
Craig Dunn
 
Introduction to Android with C# using Xamarin
Craig Dunn
 
iOS & Android apps using Parse and Xamarin
Craig Dunn
 
Azure Mobile Services - more than just cloud data
Craig Dunn
 
Cloud-enabling iOS & Android apps with C# (using Xamarin)
Craig Dunn
 
Cloudy with a Chance of Cross Platform (for Bay.NET)
Craig Dunn
 
Async Await for Mobile Apps
Craig Dunn
 
Xamarin v.Now
Craig Dunn
 
PassKit on iOS6
Craig Dunn
 
Ad

Recently uploaded (20)

PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
DOCX
Top AI API Alternatives to OpenAI: A Side-by-Side Breakdown
vilush
 
PPTX
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
PDF
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
PDF
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
Software Development Company | KodekX
KodekX
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
AVTRON Technologies LLC
 
PDF
Test Bank, Solutions for Java How to Program, An Objects-Natural Approach, 12...
famaw19526
 
PDF
Software Development Methodologies in 2025
KodekX
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Top AI API Alternatives to OpenAI: A Side-by-Side Breakdown
vilush
 
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Software Development Company | KodekX
KodekX
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
AVTRON Technologies LLC
 
Test Bank, Solutions for Java How to Program, An Objects-Natural Approach, 12...
famaw19526
 
Software Development Methodologies in 2025
KodekX
 

Cross-platform mobile dev with Mono

  • 2.  
  • 3.  
  • 4. iOS Basics Based on Mac OSX – so it's Unix Development is done with Objective-C No memory management (on iOS devices) Some 'different' syntax [[Fraction alloc] init] but readable for c# developers, particularly once you get your head around message-passing, protocols, delegates and their MVC interpretation
  • 5. Android Basics Based on Linux 2.6 – so it's Unix Development is done with Java “ Every Android application runs in its own process, with its own instance of the Dalvik virtual machine” very readable for c# developers, so existing examples and documentation are accessible
  • 6. What is Mono? Open source implementation of the CLR Linux, MacOS X, Solaris, BSD, Wii, PS3 Started in 2001, purchased by Novell in 2003, released in 2004 'binary compatible' with Microsoft .NET Existing .NET assemblies will run Includes the framework http://www.mono-project.com/ http://github.com/mono
  • 7. What is MonoTouch? Mono ('Silverlight subset') + iOS API bindings + Xcode/Interface Builder parser + Static (AOT) compiler = Native iPhone/iPad application http://monotouch.net/ Released Sept 2009
  • 8. MonoTouch System Req's To play in the simulator ( FREE ) Intel-based Mac OSX (latest : Snow Leopard) Apple's iPhone SDK (Simulator) ^ Mono for OSX MonoTouch Trial (and MonoDevelop IDE) ^ To get onto your iPhone/iPad (and into the AppStore) Apple Developer Program membership (USD99) ^ MonoTouch Prof or Enterprise license (USD399+)
  • 9. What is Mono for Android? Mono ('Silverlight subset') + Android API bindings + 'AXML' intellisense support + Visual Studio plug-in (or MonoDevelop) = Android application http://mono-android.net/ Released April 2011
  • 10. Mono for Android System Req's To play in the simulator ( FREE ) Mac OSX with MonoDevelop OR Windows (VisualStudio 2010 or MonoDevelop) Oracle's Java SDK Google's Android SDK Mono for Android Trial (and MonoDevelop IDE) To get onto a device Mono for Android Prof or Enterprise license (USD399+) To get onto Android Market Google Developer account (USD25)
  • 11. What is Mono for WP7?
  • 12. What is Mono for WP7? Kidding! Just grab the Windows Phone 7 Developer Tools (with Visual Studio 2010 Express) and use the real .NET Framework :-) There will be other sessions about WP7... just keep in mind that the non-UI code you write there can run on iOS & Android thanks to Mono :-)
  • 13. Details! Debugging Linking UI iOS Android Navigation Databinding F.A.Q.
  • 14. Debugging 'soft debugger' gets embedded in your app Can be configured (IP address, port) Binaries are much larger (of course) Allows breakpoints, step-through, call stack Works via TCP/IP, so you can debug the Simulator AND the device (untethered, so long as wifi is enabled).
  • 15. Linking Mono compiler strips out unused classes/libraries Mobile devices – size matters! Trap for young players: it might strip out stuff you want to keep! Classes/methods/properties used via Reflection Classes/methods/properties used in serialization operations By default it's disabled in DEBUG, so stuff will work there and mysteriously break in RELEASE [ Preserve (AllMembers = true )]
  • 16. Binding to iOS Native Controls 1 MonoTouch.* namespaces 'map' to the native iPhone OS SDK 'frameworks', eg. MonoTouch.UIKit contains UITableView, UITextBox/UITextBlock, UIButton MonoTouch.MapKit contains MKMapView, MKUserLocation MonoTouch.CoreLocation CLLocationCoordinate2D etc...
  • 17. Binding to iOS Native Controls 2 Layouts are generally 'absolute positioned' More like Windows Forms Views can be nested; custom views can be created You may end up 'measuring' text to get tight layouts UITableView gets used a LOT Two ways to build: Xcode / Interface Builder Programmatically ← my preference
  • 18. Interface Builder integration 1 Interface Builder is like the Visual Studio designer for ASPX and XAML – except it creates .XIB files
  • 19. Interface Builder integration 2 .designer.cs behaves similarly to .NET – detects XIB changes and generates partial classes provide a hook for your GUI controls
  • 20. Binding to Android Native Controls 1 Android.* namespaces 'map' to the native Android SDK classes, eg. Android.Widget contains ListView, Button, ImageView, TextView Android.App contains Activity, Dialog, Application etc... but some things (eg. Map) still not quite there
  • 21. Binding to Android Native Controls 2 Layout is generally 'relative' More like XAML [LinearLayout ~= StackPanel] Doesn't mean things can't overlap! Custom views can be created and referenced in your axml (namespace trick) Two ways to build: axml in the /Layout/ folder ← my preference programmatically
  • 22. Android UI Designer There isn't one! (of the same quality. Options include DroidDraw) Resource.Designer.cs Intellisense for UI elements (from .axml to c#) .axml is used to enable intellisense NOT a full partial-class linking axml-Activity * FindViewById<T> is used to wire up yourself * http://betasoftware.blogspot.com/2011/02/automated-monodroid-layout-t4-edition.html
  • 23. Navigation Getting from screen to screen StartActivity() Intent SetClass typeof(AnActivity) PutExtra Can also 'trigger' other applications PushViewController() UIViewController Subclass and pass instance … also UITabBar items
  • 24. Databinding (lists) More work that you are used to... BaseAdapter GetView Count GetItem (.ItemClick is attached to the ListView itself) UITableViewSource GetCell RowsInSection RowSelected
  • 26. F.A.Q. Questions I've been asked in the past: Filesystem Settings Sqlite WebClient Incoming connections Interfacing with the device (call, gps, camera)
  • 27. Example: RestGuide Runs on Android, iOS and Windows Phone 7 github.com/conceptdev
  • 28. Example: MIX11 Runs on Android, iOS and Windows Phone 7 mix11.confapp.com

Editor's Notes

  • #5: These examples are useful http://www.otierney.net/objective-c.html http://en.wikipedia.org/wiki/Objective-C
  • #6: These examples are useful http://www.otierney.net/objective-c.html http://en.wikipedia.org/wiki/Objective-C