• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Cross-platform mobile dev with Mono
 

Cross-platform mobile dev with Mono

on

  • 8,769 views

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)

Statistics

Views

Total Views
8,769
Views on SlideShare
7,091
Embed Views
1,678

Actions

Likes
2
Downloads
69
Comments
1

45 Embeds 1,678

http://conceptdev.blogspot.com 1063
http://www.go-mono.com 170
http://conceptdev.blogspot.co.uk 63
http://conceptdev.blogspot.de 62
http://conceptdev.blogspot.com.au 48
http://conceptdev.blogspot.fr 23
http://conceptdev.blogspot.se 22
http://conceptdev.blogspot.nl 21
http://conceptdev.blogspot.in 18
http://conceptdev.blogspot.mx 15
http://conceptdev.blogspot.ca 14
http://conceptdev.blogspot.it 12
http://go-mono.com 12
http://conceptdev.blogspot.com.es 11
http://conceptdev.blogspot.dk 10
http://twitter.com 9
http://conceptdev.blogspot.cz 8
http://paper.li 7
http://conceptdev1.rssing.com 7
http://conceptdev.blogspot.co.nz 7
http://conceptdev.blogspot.gr 6
http://conceptdev.blogspot.com.br 6
http://conceptdev.blogspot.be 5
http://conceptdev.blogspot.no 5
http://conceptdev.blogspot.jp 5
http://www.rxx.co.il 5
http://conceptdev.blogspot.ru 4
http://www.directrss.co.il 4
http://conceptdev.blogspot.ch 4
http://go-mono.net 4
http://www.techgig.com 4
http://conceptdev.blogspot.ie 3
http://www.go-mono.org 3
http://conceptdev.blogspot.pt 3
http://conceptdev.blogspot.hu 2
http://www.twylah.com 2
http://conceptdev.blogspot.ro 2
https://twitter.com 2
http://conceptdev.blogspot.sk 1
http://conceptdev.blogspot.sg 1
http://conceptdev.blogspot.hk 1
http://www.onlydoo.com 1
http://conceptdev.blogspot.co.il 1
http://us-w1.rockmelt.com 1
http://conceptdev.blogspot.tw 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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

Cross-platform mobile dev with Mono Cross-platform mobile dev with Mono Presentation Transcript

  • 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