Developing Cross-Platform
Native Apps with
Xamarin
for Boston Tech Workshops
by Dan Hermes
Xamarin MVP, Software Consultant
Lexicon Systems
dan@lexiconsystemsinc.com
www.mobilecsharpcafe.com
@danhermes
About Me
Dan Hermes
President of Lexicon Systems
Mobile and .NET software consultant
Author, speaker
My Xamarin Book
Now Available on Amazon
“This weighty book gives clear guidance that will help you
build quality apps, starting with architectural considerations,
and then jumping into practical code strategies.”
- Bryan Costanich, Vice President, Xamarin
“Dan Hermes’ extraordinary book is the most intelligent work
on cross-platform mobile development I’ve seen.”
– Jesse Liberty, Director of New Technology Development, Falafel Software,
Xamarin Certified Developer / Xamarin MVP
Why are we building
mobile apps for business?
Explosive Mobile v. PC Growth
Quarterly unit shipments (m)
300
250
200
150
100
50
0
PCs iOS & Android
March-95 March-97 March-99 March-01 March-03 March-05 March-07 March-09 March-11 March-13
Source: “Mobile is Eating the World” (Benedict Evans)
How do we build
mobile apps for business?
Mobile App Types
• Mobile Web /Responsive
• Browser-based
• Native
• iOS, Android, OR Windows
• Hybrid
• Web app wrapped in a native app
• Cross-platform
• iOS, Android, AND Windows
Native vs. Hybrid
Native User Interface and Native User Experience vs. Hybrid
People Expect Great Experiences
Which platforms
do we build for?
Smartphone OS Market Share
• Android – 66%
• iOS – 28%
• Windows Phone – 3%
What does this mean?
Single platform apps are risky
Cross-platform Apps
• Develop using a single technology (ex. C#, HTML5)
• Can run on all platforms
• iOS
• Android
• Windows Phone
What Are the Benefits
of Cross-platform Apps?
• Shared Code
• Code reuse
• One technology stack
• Instead of several
• Native app quality
• Native app performance
• Native phone functionality (location, camera, etc.)
Biggest Challenges
of Multi-platform Development
 Code Divergence
 Development Complexity
 Team Divergence
 Process Complexity
 Schedule
 Cost=
Cross-Platform Solutions
 Xamarin
 Code in C# then compile to respective native platforms
 Titanium, NativeScript & React Native
 Native shell around a JavaScript core app with some UI compiled to native
 Cordova
 Device-resident web app that can be wrapped in a native shell
Xamarin’s Approach
Native UI
C# +
XAML
Fully native apps written
entirely in C#
Shared App Logic in C#
 Xamarin delivers fully native user
interfaces and app functionality
 Complete access to 100% of the
native APIs for iOS, Android and
Windows in C#
 Share app logic and UI code across
device platforms
Xamarin Studio
 Optimized for cross-platform
mobile development
 Explore native APIs with
code completion
 World class Android and
iOS designers
 Powerful debugging on
simulator or device
Xamarin Plug-in for Visual Studio
Native Performance
Xamarin.iOS does full Ahead Of Time
(AOT) compilation to produce an ARM
binary for Apple’s App Store.
Xamarin.Android takes advantage of
Just In Time (JIT) compilation on the
Android device.
Mobile Visionary in Gartner Magic Quadrant
“Xamarin's architectural approach provides
completely native UIs with better performance than
other cross-platform techniques… Xamarin uses
multifaceted technology built by a cohesive team with a
solid long-term track record.”
Mobile Visionary in Magic Quadrant
Xamarin’s Enterprise Partnerships
The experiences your users expect.
The security and connections your organization requires.
Benefits of Cross-Platform Development
• Combine code and development teams
• Shared codebase
• Same programming skillset
• Run on multiple platforms
• iOS
• Android
• Windows Phone
Xamarin’s Default App Architecture
Native UI
C# +
XAML
Shared app logic,
platform-specific UI,
all in C#
Shared App Logic in C#
iOS C# UI Android C# UI Windows C# UI
Shared App Logic
 Platform-specific UI code in C#
 Shared app logic code in C#
 Fine-grain control over the app user
interface
 Good for apps with sophisticated UX
requirements (complicated gestures,
animations, design)
Xamarin.Forms
• Cross-platform user interface for Xamarin
• Announced in May of 2014
• Growing set of cross-platform controls
• Each control will be mapped to its native equivalent at runtime
Xamarin.Forms UI
 Xamarin.Forms features first developed for C# (code-first)
 XAML implementation then provided, so…
Anything you can do in C#, I can do in XAML
 What is XAML?
C# or XAML for UI Development
The Xamarin.Forms App Architecture
Shared App Logic
Xamarin.Forms
Increase Code Sharing Up to 100% and Deliver a Fully Native App
 Shared UI code in C#
 Shared app logic code in C#
 Mix-and-Match the use of Xamarin.Forms
with platform-specific code.
 Good for forms-based, apps with a lot of
data entry screens
 Easy to learn API makes you productive
immediately, without platform-specific
knowledge
Xamarin App Architectures
iOS C# UI Android C# UI Windows C# UI
Shared App Logic Shared App Logic
Xamarin.Forms
Platform-specific Xamarin.Forms
Page, Layout, View
Pages
Layouts
When to Use Xamarin.Forms?
• Learning Xamarin
• Cross-platform scaffolding
• Basic business apps
• Basic design
• Simple cross-platform screens
• Device-unique controls are not needed
• Complex graphics processing is not needed
Microsoft acquired Xamarin
Miguel de Icaza,
Xamarin CTO
Automatically test your app on hundreds of real
devices in the cloud
Xamarin Test Cloud – Testing Made Easy
What do I do all day?
• Develop web and mobile apps
• Xamarin experts
• Founded in 1999
• Microsoft technology stack
We advise on and build apps for business.
What We Do
a continuum of services from advisement to hands-on
Our Clients Include
and many small and medium-sized companies.
Our Proficiencies
•Web applications
• Microsoft Technologies
• C#, .NET, ASP.NET, MVC, HTML5,
Javascript
•Mobile apps
• iOS, Android, Windows Phone
• Built using Xamarin
MOBILE APPS
IN THE WILD
(Case Studies)
        
Certification training and professional platform for orthopedic surgeons
•50,000 orthopedic surgeon user base
•Surgical topics, case studies, images
•Sample tests and test questions
•Surgeons can vote, comment, and cite journal entries
Cross-platform
iOS Android
Feature-rich and Intuitive UI
          
Biotech market leader
•DNA and breast cancer research
•Engage lab techs more deeply through their ThermoFisher
equipment
•Bring real-time data directly from DNA-processing
laboratory equipment into the hands of scientists
Xammy
Finalist
Thermo Cycler or
PCR Device (polymerase chain reaction)
for DNA Duplication
PCR Essentials
Internet of Things (IoT)
Real-time Integration with Lab Devices
Federal Aviation Administration (FAA)
• Recreational drone use presents
risks and threats
• FAA announcing new regulations
• Help drone flyers fly safely
B4UFLY
• Plan your trips
• Airport locations
• Controlled Airspace
• Special Airspace
• Flight Warnings
• No-fly Zones
Xamarin gives us cross-platform reach
with native power and performance
Web and Mobile Work Together
• Modern biz apps combine web and mobile technology
• They share data sources, look and feel, and support one another
• A Unified technology foundation simplifies this
• Mobile and web apps all built with C# provides this foundation
• Xamarin
• .NET
• ASP.NET MVC
• Angular and other JavaScript options
Need Something Xamarin-flavored?
• I do Xamarin consultations
• I do Xamarin coaching and training
• My firm does Xamarin development
• We help make Xamarin projects work
Developing Cross-Platform
Native Apps with
Xamarin
Dan Hermes
developer, author, consultant,
founder of Lexicon Systems
dan@lexiconsystemsinc.com
Available on Amazon
My blog: www.mobilecsharpcafe.com
Twitter: @danhermes

Developing Cross-platform Native Apps with Xamarin

  • 1.
    Developing Cross-Platform Native Appswith Xamarin for Boston Tech Workshops by Dan Hermes Xamarin MVP, Software Consultant Lexicon Systems dan@lexiconsystemsinc.com www.mobilecsharpcafe.com @danhermes
  • 2.
    About Me Dan Hermes Presidentof Lexicon Systems Mobile and .NET software consultant Author, speaker
  • 3.
    My Xamarin Book NowAvailable on Amazon “This weighty book gives clear guidance that will help you build quality apps, starting with architectural considerations, and then jumping into practical code strategies.” - Bryan Costanich, Vice President, Xamarin “Dan Hermes’ extraordinary book is the most intelligent work on cross-platform mobile development I’ve seen.” – Jesse Liberty, Director of New Technology Development, Falafel Software, Xamarin Certified Developer / Xamarin MVP
  • 4.
    Why are webuilding mobile apps for business?
  • 5.
    Explosive Mobile v.PC Growth Quarterly unit shipments (m) 300 250 200 150 100 50 0 PCs iOS & Android March-95 March-97 March-99 March-01 March-03 March-05 March-07 March-09 March-11 March-13 Source: “Mobile is Eating the World” (Benedict Evans)
  • 6.
    How do webuild mobile apps for business?
  • 7.
    Mobile App Types •Mobile Web /Responsive • Browser-based • Native • iOS, Android, OR Windows • Hybrid • Web app wrapped in a native app • Cross-platform • iOS, Android, AND Windows
  • 8.
    Native vs. Hybrid NativeUser Interface and Native User Experience vs. Hybrid
  • 9.
  • 10.
  • 11.
    Smartphone OS MarketShare • Android – 66% • iOS – 28% • Windows Phone – 3% What does this mean? Single platform apps are risky
  • 12.
    Cross-platform Apps • Developusing a single technology (ex. C#, HTML5) • Can run on all platforms • iOS • Android • Windows Phone
  • 13.
    What Are theBenefits of Cross-platform Apps? • Shared Code • Code reuse • One technology stack • Instead of several • Native app quality • Native app performance • Native phone functionality (location, camera, etc.)
  • 14.
    Biggest Challenges of Multi-platformDevelopment  Code Divergence  Development Complexity  Team Divergence  Process Complexity  Schedule  Cost=
  • 15.
    Cross-Platform Solutions  Xamarin Code in C# then compile to respective native platforms  Titanium, NativeScript & React Native  Native shell around a JavaScript core app with some UI compiled to native  Cordova  Device-resident web app that can be wrapped in a native shell
  • 16.
    Xamarin’s Approach Native UI C#+ XAML Fully native apps written entirely in C# Shared App Logic in C#  Xamarin delivers fully native user interfaces and app functionality  Complete access to 100% of the native APIs for iOS, Android and Windows in C#  Share app logic and UI code across device platforms
  • 17.
    Xamarin Studio  Optimizedfor cross-platform mobile development  Explore native APIs with code completion  World class Android and iOS designers  Powerful debugging on simulator or device
  • 18.
    Xamarin Plug-in forVisual Studio
  • 20.
    Native Performance Xamarin.iOS doesfull Ahead Of Time (AOT) compilation to produce an ARM binary for Apple’s App Store. Xamarin.Android takes advantage of Just In Time (JIT) compilation on the Android device.
  • 21.
    Mobile Visionary inGartner Magic Quadrant “Xamarin's architectural approach provides completely native UIs with better performance than other cross-platform techniques… Xamarin uses multifaceted technology built by a cohesive team with a solid long-term track record.” Mobile Visionary in Magic Quadrant
  • 22.
    Xamarin’s Enterprise Partnerships Theexperiences your users expect. The security and connections your organization requires.
  • 24.
    Benefits of Cross-PlatformDevelopment • Combine code and development teams • Shared codebase • Same programming skillset • Run on multiple platforms • iOS • Android • Windows Phone
  • 25.
    Xamarin’s Default AppArchitecture Native UI C# + XAML Shared app logic, platform-specific UI, all in C# Shared App Logic in C# iOS C# UI Android C# UI Windows C# UI Shared App Logic  Platform-specific UI code in C#  Shared app logic code in C#  Fine-grain control over the app user interface  Good for apps with sophisticated UX requirements (complicated gestures, animations, design)
  • 26.
    Xamarin.Forms • Cross-platform userinterface for Xamarin • Announced in May of 2014 • Growing set of cross-platform controls • Each control will be mapped to its native equivalent at runtime
  • 28.
    Xamarin.Forms UI  Xamarin.Formsfeatures first developed for C# (code-first)  XAML implementation then provided, so… Anything you can do in C#, I can do in XAML  What is XAML? C# or XAML for UI Development
  • 29.
    The Xamarin.Forms AppArchitecture Shared App Logic Xamarin.Forms Increase Code Sharing Up to 100% and Deliver a Fully Native App  Shared UI code in C#  Shared app logic code in C#  Mix-and-Match the use of Xamarin.Forms with platform-specific code.  Good for forms-based, apps with a lot of data entry screens  Easy to learn API makes you productive immediately, without platform-specific knowledge
  • 30.
    Xamarin App Architectures iOSC# UI Android C# UI Windows C# UI Shared App Logic Shared App Logic Xamarin.Forms Platform-specific Xamarin.Forms
  • 31.
  • 32.
  • 33.
  • 34.
    When to UseXamarin.Forms? • Learning Xamarin • Cross-platform scaffolding • Basic business apps • Basic design • Simple cross-platform screens • Device-unique controls are not needed • Complex graphics processing is not needed
  • 35.
  • 36.
  • 37.
    Automatically test yourapp on hundreds of real devices in the cloud
  • 38.
    Xamarin Test Cloud– Testing Made Easy
  • 39.
    What do Ido all day?
  • 40.
    • Develop weband mobile apps • Xamarin experts • Founded in 1999 • Microsoft technology stack We advise on and build apps for business.
  • 41.
    What We Do acontinuum of services from advisement to hands-on
  • 42.
    Our Clients Include andmany small and medium-sized companies.
  • 43.
    Our Proficiencies •Web applications •Microsoft Technologies • C#, .NET, ASP.NET, MVC, HTML5, Javascript •Mobile apps • iOS, Android, Windows Phone • Built using Xamarin
  • 44.
    MOBILE APPS IN THEWILD (Case Studies)
  • 45.
             Certification training andprofessional platform for orthopedic surgeons •50,000 orthopedic surgeon user base •Surgical topics, case studies, images •Sample tests and test questions •Surgeons can vote, comment, and cite journal entries
  • 47.
  • 48.
  • 50.
               Biotech market leader •DNAand breast cancer research •Engage lab techs more deeply through their ThermoFisher equipment •Bring real-time data directly from DNA-processing laboratory equipment into the hands of scientists Xammy Finalist
  • 51.
    Thermo Cycler or PCRDevice (polymerase chain reaction) for DNA Duplication
  • 52.
  • 53.
    Internet of Things(IoT) Real-time Integration with Lab Devices
  • 55.
    Federal Aviation Administration(FAA) • Recreational drone use presents risks and threats • FAA announcing new regulations • Help drone flyers fly safely
  • 56.
    B4UFLY • Plan yourtrips • Airport locations • Controlled Airspace • Special Airspace • Flight Warnings • No-fly Zones
  • 57.
    Xamarin gives uscross-platform reach with native power and performance
  • 58.
    Web and MobileWork Together • Modern biz apps combine web and mobile technology • They share data sources, look and feel, and support one another • A Unified technology foundation simplifies this • Mobile and web apps all built with C# provides this foundation • Xamarin • .NET • ASP.NET MVC • Angular and other JavaScript options
  • 59.
    Need Something Xamarin-flavored? •I do Xamarin consultations • I do Xamarin coaching and training • My firm does Xamarin development • We help make Xamarin projects work
  • 60.
    Developing Cross-Platform Native Appswith Xamarin Dan Hermes developer, author, consultant, founder of Lexicon Systems dan@lexiconsystemsinc.com Available on Amazon My blog: www.mobilecsharpcafe.com Twitter: @danhermes

Editor's Notes

  • #16 Xamarin is the only major framework that compiles to respective native binaries for a 100% native application. Appcelerator’s Titanium, Telerik’s NativeScript and Facebook’s React Native have 100% native UIs but offshore their logic to the native JavaScript engine.
  • #24 Your customers are going mobile
  • #25 Notes Can save time by reusing code Can save money
  • #27 Notes: Since being announced, Xamarin.Forms has grown and will continue to grow Controls are added occasionally when updates are made to Xamarin When the application is run, a control that is abstracted in Xamarin.Forms will be mapped to its native equivalent. For example, the Xamarin.Forms.Button control maps to UIButton in iOS, Button in Android and Button in Windows Phone References: Image Source: http://www.meritsolutions.com/wp-content/uploads/2015/09/Xamarin-Approach-1024x491.png
  • #29 Notes: Platform-specific is sometimes called Traditional architecture, and uses Xamarin.Android or Xamarin.iOS.
  • #32 References: Xamarin Mobile Application Development by Dan Hermes http://amzn.to/1rowG7K
  • #33 Image courtesy of Xamarin
  • #34 Image courtesy of Xamarin
  • #53 Full-featured E-Commerce, Video Education, Calculator, and IoT Device Integration
  • #56 As with anything really fun…