SlideShare a Scribd company logo
1 of 42
MONOTOUCH


Easier development of iOS applications using C#




                 NNUG Bergen
                  Jonas Follesø
                  29/02/2012
ABOUT ME




           Jonas Follesø
           Scientist & Manager BEKK Trondheim
AGENDA



         What is MonoTouch?
         FizzBuzz Demo + Unit Testing
         Buss Schedule Demo
         Cross Platform Apps
         Xamarin.Mobile + MonoTouch.Dialog
What is
Mono?
WHAT IS MONO?




• Open source implementation of the .NET
  platform

• 2001: Created to bring Windows applications to
  Linux

• 2003: Acquired by Novell with Ximian

• Matured at Novell – now a world-class runtime.
WHAT IS MONO?



       C#



    IronRuby



   IronPython



   Visual Basic



       F#
C# on iOS
(iPhone, iPod Touch, iPad)
15% discount for NNUG
 Commercial Product


   339$
   399$
xamarin.com/nnug
(Free to run in emulator)
Demo:
FizzBuzz
UNIT TESTING MONOTOUCH APPS



                         • NUnit Lite Runner on device/simulator


                         • Same NUnit syntax you already know


                         • Possible to run the same NUnit tests on
                           desktop, iOS and WP7 device
Demo:
Unit Testing
.NET & MONO JIT ENGINE




    C#                                         Memory
                                                Executable
  Source Code
                                               Machine Code




                MSIL            Mono
                                Just In Time
                .NET Bytecode
                                Compilation
AHEAD-OF-TIME COMPILATION



• Apple disallows Just-In-Time compilation (JIT)


• Cannot make writable memory executable – enforced by OS


• MonoTouch uses Ahead-of-Time Compilation (AOT)
  • Generates the native code that JIT would normally generate


• Links to runtime to create single ARM process capable native binary
AHEAD-OF-TIME COMPILATION




  MSIL
 .NET Bytecode
                                     Native Code


                   Mono                Mono
                 Cross Compilation
                     (mtouch)
                                      Runtime
Thin layer
  on top of
Cocoa Touch
Same UI
Components
native look & fell
MONOTOUCH APIS



.NET APIs                 Native APIs               3rd Party APIs



•   mscorlib              •   AddressBook           •   OpenTK
•   System                •   AudioToolbox          •   OpenGL
•   System.Core (LINQ)    •   CoreAnimation         •   OpenAL
•   System.Data           •   CoreGraphics          •   SQLite
•   Mono.Data.Sqlite      •   CoreLocation          •   MonoGame
•   System.ServiceModel   •   EventKit/EventKitUI   •   RestSharp
•   System.Json           •   ExternalAccessory     •   Json.NET
•   System.Web.Services   •   GameKit               •   ServiceStack
•   System.Xml            •   MapKit                •   Steema TeeChart
•   System.Xml.Linq       •   NewsstandKit          •   Flurry Analytics
                          •   StoreKit              •   RedLaser
                          •   UIKit                 •   And so on...
                          •   And so on...
Demo:
  Buss
Schedule
Cross Platform
   Mobile
 Development
REUSABLE CODE



Easily Reusable        Reusable with some effort   Not reusable

• Domain Model         • Code accessing            • User Interface Code
                         platform specific
                         components that
• Clients for your       exist across all          • Boot Strapping
  REST- and web          platforms                   Code
  services
                         •   GPS
• Data Access Code       • Contacts
  (SQLite)               • Picture Library
                         • Accelerometer
• Storage Code
  (Isolated Storage)


• Business Logic
CODE REUSE FOR MWC APP



•   100% reuse of Core Library (1635 LOC)   iOS    Android    WP7


•   iPhone + iPad (2476 LOC)                                 65%
•   Android (1095 LOC)
•   WP7 (896 LOC)


                                                    60%


                                             57%
COMMON API FOR SHARED FUNCTIONALITY




                    Xamarin.Mobile


                            Compass +
  Contacts   Geolocation                   Camera   Notifications
                           Accelerometer
XAMARIN.MEDIA.MEDIAPICKER



   ImageView image = FindViewById<ImageView> (Resource.Id.image);


   var picker = new MediaPicker (this);
   picker.PickPhotoAsync()
        .ContinueWith (t => {
          if (t.IsCanceled || t.IsFaulted) // user canceled or error
                  return;

          Bitmap b = BitmapFactory.DecodeFile (t.Result.Path);
          RunOnUiThread (() => image.SetImageBitmap (b));
    });
XAMARIN.MEDIA.MEDIAPICKER
Demo:
Xamarin.
 Mobile
Create UI faster
      using
MonoTouch.Dialog
GREATLY SIMPLIFIES CREATION OF SIMPLE UIS
TWO APIS: ELEMENTS API



•    MonoTouch.Dialog is a framework that brings declarative UI programming to iOS


return new RootElement ("Settings") {
    new Section (){
      new BooleanElement ("Airplane Mode", false),
      new RootElement ("Notifications", 0, 0) {
            new Section (null,
                "Turn off Notifications to disable Soundsn" +
                   "Alerts and Home Screen Badges for thenapplications below."){
                new BooleanElement ("Notifications", false)
            }
      }},
TWO APIS – REFLECTION API



                            class AccountInfo {
                               [Section]
                               public bool AirplaneMode;

                                [Section ("Data Entry", "Your credentials")]

                                [Entry ("Enter your login name")]
                                public string Login;

                                [Caption ("Password"),
                                 Password ("Enter your password")]
                                public string passwd;

                                [Section ("Travel options")]
                                public SeatPreference preference;
                            }
Demo:
MonoTouch.Dialog
Is it ready
for business?
CONTROVERSY 1: APRIL 2010 – APPLE’S SECTION 3.3.1



• April 8nd: Apple changed license to state that:

  “Applications must be originally written in Objective-C, C, C++, or
  JavaScript as executed by the iPhone OS WebKit engine, and only code written in
  C, C++, and Objective-C may compile and directly link against the Documented
  APIs…”


• September 9th: Apple changed license again:

  “In particular, we are relaxing all restrictions on the development tools used to create
  iOS apps, as long as the resulting apps do not download any code. This should give
  developers the flexibility they want, while preserving the security we need.”
CONTROVERSY 2: MAY 2011 - ATTACHEMATE



• May 2nd: Attachemate buys Novell – Mono team laid off


• Xamarin founded 2 weeks later


• Angry Mono customers pressure Novell to cooperate with Xamarin


• Xamarin secures a perpetual license to all Mono IP:
  copyrights, patents and trademarks
Basically:
All good!
MONOTOUCH & iOS RELEASE HISTORY




2009.07.17      2010.04.03   2010.06.21    2010.06.21   2011.10.12
 iOS v3.0        iOS v3.2     iOS v4.0      iOS v4.0     iOS v5.0
                  (iPad)




                2010.04.05
                 MT v2.0
   2009.09.14     (iPad)                  2011.04.06    2011.10.12   2012.01.17
    MT v1.0                                MT v4.0       MT v5.0     MT v5.2.5

                   2010.04.05
                    MT v3.0
                   (iPhone 4)
Summary
SUMMARY



C# for iOS                 Cross Platform                  Useful resources

•   Makes iOS easily       •   Standard .NET libraries     •   http://xamarin.com/NNU
    accessible for .NET        for tasks such as:              G for 15% discount on
    developers.                                                MonoTouch & Mono for
                               •   File Access                 Android

•   Thin layer on top of       •   Database Access
    CocoaTouch – same          •   Web Service Access      •   https://github.com/folles
    native look & feel                                         oe/FlightsNorway/tree/w
                               •   Business Logic              orkshop for 50 page
                                                               workshop on cross
•   MonoTouch.Dialog for                                       platform development
    easier UI creation     •   Xamarin.Mobile provides         using Mono.
                               same API for common
                               phone functionality


                           •   NDC 2011 presentation
                               on cross platform mobile:
                               http://vimeo.com/267016
                               39
Questions?

More Related Content

Viewers also liked

Hvordan lage en vellykket Windows Phone 7 App
Hvordan lage en vellykket Windows Phone 7 AppHvordan lage en vellykket Windows Phone 7 App
Hvordan lage en vellykket Windows Phone 7 AppJonas Follesø
 
Hvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjonHvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjonJonas Follesø
 
Why learn new programming languages
Why learn new programming languagesWhy learn new programming languages
Why learn new programming languagesJonas Follesø
 
Smidig 2011 TDD Workshop
Smidig 2011 TDD WorkshopSmidig 2011 TDD Workshop
Smidig 2011 TDD WorkshopJonas Follesø
 
BK2011 Trafikanten - Et webprosjekt med full oppgradering av karttjenester
BK2011 Trafikanten - Et webprosjekt med full oppgradering av karttjenesterBK2011 Trafikanten - Et webprosjekt med full oppgradering av karttjenester
BK2011 Trafikanten - Et webprosjekt med full oppgradering av karttjenesterGeodata AS
 
Get a flying start with Windows Phone 7 - NDC2010
Get a flying start with Windows Phone 7 - NDC2010Get a flying start with Windows Phone 7 - NDC2010
Get a flying start with Windows Phone 7 - NDC2010Jonas Follesø
 
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)Jonas Follesø
 
Cross platform mobile apps using .NET
Cross platform mobile apps using .NETCross platform mobile apps using .NET
Cross platform mobile apps using .NETJonas Follesø
 

Viewers also liked (8)

Hvordan lage en vellykket Windows Phone 7 App
Hvordan lage en vellykket Windows Phone 7 AppHvordan lage en vellykket Windows Phone 7 App
Hvordan lage en vellykket Windows Phone 7 App
 
Hvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjonHvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjon
 
Why learn new programming languages
Why learn new programming languagesWhy learn new programming languages
Why learn new programming languages
 
Smidig 2011 TDD Workshop
Smidig 2011 TDD WorkshopSmidig 2011 TDD Workshop
Smidig 2011 TDD Workshop
 
BK2011 Trafikanten - Et webprosjekt med full oppgradering av karttjenester
BK2011 Trafikanten - Et webprosjekt med full oppgradering av karttjenesterBK2011 Trafikanten - Et webprosjekt med full oppgradering av karttjenester
BK2011 Trafikanten - Et webprosjekt med full oppgradering av karttjenester
 
Get a flying start with Windows Phone 7 - NDC2010
Get a flying start with Windows Phone 7 - NDC2010Get a flying start with Windows Phone 7 - NDC2010
Get a flying start with Windows Phone 7 - NDC2010
 
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
 
Cross platform mobile apps using .NET
Cross platform mobile apps using .NETCross platform mobile apps using .NET
Cross platform mobile apps using .NET
 

Similar to Introduction to MonoTouch

Introduction to Cross Platform Development with Xamarin/ Visual Studio
Introduction to Cross Platform Development with Xamarin/ Visual StudioIntroduction to Cross Platform Development with Xamarin/ Visual Studio
Introduction to Cross Platform Development with Xamarin/ Visual StudioIndyMobileNetDev
 
Italian Alt.Net Conference MonoTouch Session
Italian Alt.Net Conference MonoTouch SessionItalian Alt.Net Conference MonoTouch Session
Italian Alt.Net Conference MonoTouch SessionChris Hardy
 
Introduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for AndroidIntroduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for AndroidChris Hardy
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouchmobiweave
 
C# On The iPhone with MonoTouch at DDD8
C# On The iPhone with MonoTouch at DDD8C# On The iPhone with MonoTouch at DDD8
C# On The iPhone with MonoTouch at DDD8Chris Hardy
 
Bienvenido .Net MAUI - la evolución de Xamarin.Forms
Bienvenido .Net MAUI - la evolución de Xamarin.FormsBienvenido .Net MAUI - la evolución de Xamarin.Forms
Bienvenido .Net MAUI - la evolución de Xamarin.FormsVicente Gerardo Guzman Lucio
 
C# on the iPhone with MonoTouch Glasgow
C# on the iPhone with MonoTouch GlasgowC# on the iPhone with MonoTouch Glasgow
C# on the iPhone with MonoTouch GlasgowChris Hardy
 
Mono for .NET Developers
Mono for .NET DevelopersMono for .NET Developers
Mono for .NET Developersjeffz
 
developementofmobileapplication-160412025313 (1).pptx
developementofmobileapplication-160412025313 (1).pptxdevelopementofmobileapplication-160412025313 (1).pptx
developementofmobileapplication-160412025313 (1).pptxPoooi2
 
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...Bala Subra
 
iOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET GuyiOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET GuyNick Landry
 
Mobile Backend Apps and APIs meetup London overview of BaaS APIs and discussi...
Mobile Backend Apps and APIs meetup London overview of BaaS APIs and discussi...Mobile Backend Apps and APIs meetup London overview of BaaS APIs and discussi...
Mobile Backend Apps and APIs meetup London overview of BaaS APIs and discussi...Taras Filatov
 
WP7, Droid, iPhone, Oh my!
WP7, Droid, iPhone, Oh my!WP7, Droid, iPhone, Oh my!
WP7, Droid, iPhone, Oh my!Chris Hardy
 
Cross platform development with c# and xamarin
Cross platform development with c# and xamarinCross platform development with c# and xamarin
Cross platform development with c# and xamarinLuca Zulian
 
Mono for Android... for Google Devs
Mono for Android... for Google DevsMono for Android... for Google Devs
Mono for Android... for Google DevsCraig Dunn
 
Developing a native mobile apps using Ionic&Cordova
Developing a native mobile apps using Ionic&CordovaDeveloping a native mobile apps using Ionic&Cordova
Developing a native mobile apps using Ionic&CordovaDamir Beylkhanov
 
webOS App by Example: Sorting Thoughts
webOS App by Example: Sorting ThoughtswebOS App by Example: Sorting Thoughts
webOS App by Example: Sorting ThoughtsHendrik Ebel
 

Similar to Introduction to MonoTouch (20)

Introduction to Cross Platform Development with Xamarin/ Visual Studio
Introduction to Cross Platform Development with Xamarin/ Visual StudioIntroduction to Cross Platform Development with Xamarin/ Visual Studio
Introduction to Cross Platform Development with Xamarin/ Visual Studio
 
Italian Alt.Net Conference MonoTouch Session
Italian Alt.Net Conference MonoTouch SessionItalian Alt.Net Conference MonoTouch Session
Italian Alt.Net Conference MonoTouch Session
 
Introduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for AndroidIntroduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for Android
 
Eco system apps
Eco system appsEco system apps
Eco system apps
 
Xamarin v.Now
Xamarin v.NowXamarin v.Now
Xamarin v.Now
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouch
 
C# On The iPhone with MonoTouch at DDD8
C# On The iPhone with MonoTouch at DDD8C# On The iPhone with MonoTouch at DDD8
C# On The iPhone with MonoTouch at DDD8
 
Bienvenido .Net MAUI - la evolución de Xamarin.Forms
Bienvenido .Net MAUI - la evolución de Xamarin.FormsBienvenido .Net MAUI - la evolución de Xamarin.Forms
Bienvenido .Net MAUI - la evolución de Xamarin.Forms
 
C# on the iPhone with MonoTouch Glasgow
C# on the iPhone with MonoTouch GlasgowC# on the iPhone with MonoTouch Glasgow
C# on the iPhone with MonoTouch Glasgow
 
Mono for .NET Developers
Mono for .NET DevelopersMono for .NET Developers
Mono for .NET Developers
 
developementofmobileapplication-160412025313 (1).pptx
developementofmobileapplication-160412025313 (1).pptxdevelopementofmobileapplication-160412025313 (1).pptx
developementofmobileapplication-160412025313 (1).pptx
 
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
 
iOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET GuyiOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET Guy
 
Mobile Backend Apps and APIs meetup London overview of BaaS APIs and discussi...
Mobile Backend Apps and APIs meetup London overview of BaaS APIs and discussi...Mobile Backend Apps and APIs meetup London overview of BaaS APIs and discussi...
Mobile Backend Apps and APIs meetup London overview of BaaS APIs and discussi...
 
WP7, Droid, iPhone, Oh my!
WP7, Droid, iPhone, Oh my!WP7, Droid, iPhone, Oh my!
WP7, Droid, iPhone, Oh my!
 
Cross platform development with c# and xamarin
Cross platform development with c# and xamarinCross platform development with c# and xamarin
Cross platform development with c# and xamarin
 
Mono for Android... for Google Devs
Mono for Android... for Google DevsMono for Android... for Google Devs
Mono for Android... for Google Devs
 
Firefox os
Firefox osFirefox os
Firefox os
 
Developing a native mobile apps using Ionic&Cordova
Developing a native mobile apps using Ionic&CordovaDeveloping a native mobile apps using Ionic&Cordova
Developing a native mobile apps using Ionic&Cordova
 
webOS App by Example: Sorting Thoughts
webOS App by Example: Sorting ThoughtswebOS App by Example: Sorting Thoughts
webOS App by Example: Sorting Thoughts
 

More from Jonas Follesø

Windows Phone 7 lyntale fra Grensesnittet Desember 2010
Windows Phone 7 lyntale fra Grensesnittet Desember 2010Windows Phone 7 lyntale fra Grensesnittet Desember 2010
Windows Phone 7 lyntale fra Grensesnittet Desember 2010Jonas Follesø
 
NNUG Trondheim 30.09.2010 - Windows Phone 7
NNUG Trondheim 30.09.2010 -  Windows Phone 7NNUG Trondheim 30.09.2010 -  Windows Phone 7
NNUG Trondheim 30.09.2010 - Windows Phone 7Jonas Follesø
 
Generating characterization tests for legacy code
Generating characterization tests for legacy codeGenerating characterization tests for legacy code
Generating characterization tests for legacy codeJonas Follesø
 
MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009Jonas Follesø
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Jonas Follesø
 

More from Jonas Follesø (6)

Introduction to F#
Introduction to F#Introduction to F#
Introduction to F#
 
Windows Phone 7 lyntale fra Grensesnittet Desember 2010
Windows Phone 7 lyntale fra Grensesnittet Desember 2010Windows Phone 7 lyntale fra Grensesnittet Desember 2010
Windows Phone 7 lyntale fra Grensesnittet Desember 2010
 
NNUG Trondheim 30.09.2010 - Windows Phone 7
NNUG Trondheim 30.09.2010 -  Windows Phone 7NNUG Trondheim 30.09.2010 -  Windows Phone 7
NNUG Trondheim 30.09.2010 - Windows Phone 7
 
Generating characterization tests for legacy code
Generating characterization tests for legacy codeGenerating characterization tests for legacy code
Generating characterization tests for legacy code
 
MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 

Introduction to MonoTouch

  • 1.
  • 2. MONOTOUCH Easier development of iOS applications using C# NNUG Bergen Jonas Follesø 29/02/2012
  • 3. ABOUT ME Jonas Follesø Scientist & Manager BEKK Trondheim
  • 4. AGENDA What is MonoTouch? FizzBuzz Demo + Unit Testing Buss Schedule Demo Cross Platform Apps Xamarin.Mobile + MonoTouch.Dialog
  • 6. WHAT IS MONO? • Open source implementation of the .NET platform • 2001: Created to bring Windows applications to Linux • 2003: Acquired by Novell with Ximian • Matured at Novell – now a world-class runtime.
  • 7. WHAT IS MONO? C# IronRuby IronPython Visual Basic F#
  • 8. C# on iOS (iPhone, iPod Touch, iPad)
  • 9. 15% discount for NNUG Commercial Product 339$ 399$ xamarin.com/nnug (Free to run in emulator)
  • 11. UNIT TESTING MONOTOUCH APPS • NUnit Lite Runner on device/simulator • Same NUnit syntax you already know • Possible to run the same NUnit tests on desktop, iOS and WP7 device
  • 13. .NET & MONO JIT ENGINE C# Memory Executable Source Code Machine Code MSIL Mono Just In Time .NET Bytecode Compilation
  • 14. AHEAD-OF-TIME COMPILATION • Apple disallows Just-In-Time compilation (JIT) • Cannot make writable memory executable – enforced by OS • MonoTouch uses Ahead-of-Time Compilation (AOT) • Generates the native code that JIT would normally generate • Links to runtime to create single ARM process capable native binary
  • 15. AHEAD-OF-TIME COMPILATION MSIL .NET Bytecode Native Code Mono Mono Cross Compilation (mtouch) Runtime
  • 16. Thin layer on top of Cocoa Touch
  • 18. MONOTOUCH APIS .NET APIs Native APIs 3rd Party APIs • mscorlib • AddressBook • OpenTK • System • AudioToolbox • OpenGL • System.Core (LINQ) • CoreAnimation • OpenAL • System.Data • CoreGraphics • SQLite • Mono.Data.Sqlite • CoreLocation • MonoGame • System.ServiceModel • EventKit/EventKitUI • RestSharp • System.Json • ExternalAccessory • Json.NET • System.Web.Services • GameKit • ServiceStack • System.Xml • MapKit • Steema TeeChart • System.Xml.Linq • NewsstandKit • Flurry Analytics • StoreKit • RedLaser • UIKit • And so on... • And so on...
  • 20. Cross Platform Mobile Development
  • 21. REUSABLE CODE Easily Reusable Reusable with some effort Not reusable • Domain Model • Code accessing • User Interface Code platform specific components that • Clients for your exist across all • Boot Strapping REST- and web platforms Code services • GPS • Data Access Code • Contacts (SQLite) • Picture Library • Accelerometer • Storage Code (Isolated Storage) • Business Logic
  • 22.
  • 23.
  • 24.
  • 25. CODE REUSE FOR MWC APP • 100% reuse of Core Library (1635 LOC) iOS Android WP7 • iPhone + iPad (2476 LOC) 65% • Android (1095 LOC) • WP7 (896 LOC) 60% 57%
  • 26. COMMON API FOR SHARED FUNCTIONALITY Xamarin.Mobile Compass + Contacts Geolocation Camera Notifications Accelerometer
  • 27. XAMARIN.MEDIA.MEDIAPICKER ImageView image = FindViewById<ImageView> (Resource.Id.image); var picker = new MediaPicker (this); picker.PickPhotoAsync() .ContinueWith (t => { if (t.IsCanceled || t.IsFaulted) // user canceled or error return; Bitmap b = BitmapFactory.DecodeFile (t.Result.Path); RunOnUiThread (() => image.SetImageBitmap (b)); });
  • 30. Create UI faster using MonoTouch.Dialog
  • 32. TWO APIS: ELEMENTS API • MonoTouch.Dialog is a framework that brings declarative UI programming to iOS return new RootElement ("Settings") { new Section (){ new BooleanElement ("Airplane Mode", false), new RootElement ("Notifications", 0, 0) { new Section (null, "Turn off Notifications to disable Soundsn" + "Alerts and Home Screen Badges for thenapplications below."){ new BooleanElement ("Notifications", false) } }},
  • 33. TWO APIS – REFLECTION API class AccountInfo { [Section] public bool AirplaneMode; [Section ("Data Entry", "Your credentials")] [Entry ("Enter your login name")] public string Login; [Caption ("Password"), Password ("Enter your password")] public string passwd; [Section ("Travel options")] public SeatPreference preference; }
  • 35. Is it ready for business?
  • 36. CONTROVERSY 1: APRIL 2010 – APPLE’S SECTION 3.3.1 • April 8nd: Apple changed license to state that: “Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs…” • September 9th: Apple changed license again: “In particular, we are relaxing all restrictions on the development tools used to create iOS apps, as long as the resulting apps do not download any code. This should give developers the flexibility they want, while preserving the security we need.”
  • 37. CONTROVERSY 2: MAY 2011 - ATTACHEMATE • May 2nd: Attachemate buys Novell – Mono team laid off • Xamarin founded 2 weeks later • Angry Mono customers pressure Novell to cooperate with Xamarin • Xamarin secures a perpetual license to all Mono IP: copyrights, patents and trademarks
  • 39. MONOTOUCH & iOS RELEASE HISTORY 2009.07.17 2010.04.03 2010.06.21 2010.06.21 2011.10.12 iOS v3.0 iOS v3.2 iOS v4.0 iOS v4.0 iOS v5.0 (iPad) 2010.04.05 MT v2.0 2009.09.14 (iPad) 2011.04.06 2011.10.12 2012.01.17 MT v1.0 MT v4.0 MT v5.0 MT v5.2.5 2010.04.05 MT v3.0 (iPhone 4)
  • 41. SUMMARY C# for iOS Cross Platform Useful resources • Makes iOS easily • Standard .NET libraries • http://xamarin.com/NNU accessible for .NET for tasks such as: G for 15% discount on developers. MonoTouch & Mono for • File Access Android • Thin layer on top of • Database Access CocoaTouch – same • Web Service Access • https://github.com/folles native look & feel oe/FlightsNorway/tree/w • Business Logic orkshop for 50 page workshop on cross • MonoTouch.Dialog for platform development easier UI creation • Xamarin.Mobile provides using Mono. same API for common phone functionality • NDC 2011 presentation on cross platform mobile: http://vimeo.com/267016 39