Your SlideShare is downloading. ×
Cross-platform mobile dev with Mono
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Cross-platform mobile dev with Mono

8,525

Published on

Cross-platform mobile development with Mono (MonoTouch & Mono-for-Android). Presentation from 7th May 2011 at Mobile Camp Oz (Bathurst, NSW, Australia)

Cross-platform mobile development with Mono (MonoTouch & Mono-for-Android). Presentation from 7th May 2011 at Mobile Camp Oz (Bathurst, NSW, Australia)

Published in: Technology
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total Views
8,525
On Slideshare
0
From Embeds
0
Number of Embeds
29
Actions
Shares
0
Downloads
80
Comments
1
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • These examples are useful http://www.otierney.net/objective-c.html http://en.wikipedia.org/wiki/Objective-C
  • These examples are useful http://www.otierney.net/objective-c.html http://en.wikipedia.org/wiki/Objective-C
  • Transcript

    • 1. Multi-platform 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
    • 25. 'translation'
    • 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
    • 29. Any questions?
    • 30. Professional iPhone w/ MonoTouch

    ×