60
Developing Cross- Platform Native Apps with Xamarin for Boston Tech Workshops by Dan Hermes Xamarin MVP, Software Consultant Lexicon Systems [email protected] www.mobilecsharpcafe.com @danhermes

Developing Cross-platform Native Apps with Xamarin

Embed Size (px)

Citation preview

Page 1: Developing Cross-platform Native Apps with Xamarin

Developing Cross-Platform

Native Apps with Xamarin

for Boston Tech Workshops

by Dan HermesXamarin MVP, Software ConsultantLexicon Systems

[email protected]@danhermes

Page 2: Developing Cross-platform Native Apps with Xamarin

About Me

Dan HermesPresident of Lexicon SystemsMobile and .NET software consultantAuthor, speaker

Page 3: Developing Cross-platform Native Apps with Xamarin

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

Page 4: Developing Cross-platform Native Apps with Xamarin

Why are we building mobile apps for business?

Page 5: Developing Cross-platform Native Apps with Xamarin

Explosive Mobile v. PC GrowthQuarterly 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)

Page 6: Developing Cross-platform Native Apps with Xamarin

How do we buildmobile apps for business?

Page 7: Developing Cross-platform Native Apps with Xamarin

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

Page 8: Developing Cross-platform Native Apps with Xamarin

Native vs. Hybrid

Native User Interface and Native User Experience vs. Hybrid

Page 9: Developing Cross-platform Native Apps with Xamarin

People Expect Great Experiences

Page 10: Developing Cross-platform Native Apps with Xamarin

Which platforms do we build for?

Page 11: Developing Cross-platform Native Apps with Xamarin

Smartphone OS Market Share

• Android – 66%• iOS – 28%• Windows Phone – 3%

What does this mean?

Single platform apps are risky

Page 12: Developing Cross-platform Native Apps with Xamarin

Cross-platform Apps

• Develop using a single technology (ex. C#, HTML5)• Can run on all platforms

• iOS• Android• Windows Phone

Page 13: Developing Cross-platform Native Apps with Xamarin

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.)

Page 14: Developing Cross-platform Native Apps with Xamarin

Biggest Challenges of Multi-platform Development

Code Divergence Development Complexity Team Divergence Process Complexity

Schedule Cost=

Page 15: Developing Cross-platform Native Apps with Xamarin

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

Page 16: Developing Cross-platform Native Apps with Xamarin

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

Page 17: Developing Cross-platform Native Apps with Xamarin

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

Page 18: Developing Cross-platform Native Apps with Xamarin

Xamarin Plug-in for Visual Studio

Page 19: Developing Cross-platform Native Apps with Xamarin
Page 20: Developing Cross-platform Native Apps with Xamarin

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.

Page 21: Developing Cross-platform Native Apps with Xamarin

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

Page 22: Developing Cross-platform Native Apps with Xamarin

Xamarin’s Enterprise Partnerships

The experiences your users expect.The security and connections your organization requires.

Page 23: Developing Cross-platform Native Apps with Xamarin
Page 24: Developing Cross-platform Native Apps with Xamarin

Benefits of Cross-Platform Development • Combine code and development teams

• Shared codebase• Same programming skillset

• Run on multiple platforms• iOS• Android• Windows Phone

Gavin Gear
This slide feels sparse :0
Page 25: Developing Cross-platform Native Apps with Xamarin

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)

Page 26: Developing Cross-platform Native Apps with Xamarin

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

Page 27: Developing Cross-platform Native Apps with Xamarin
Page 28: Developing Cross-platform Native Apps with Xamarin

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

Page 29: Developing Cross-platform Native Apps with Xamarin

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

Page 30: Developing Cross-platform Native Apps with Xamarin

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 31: Developing Cross-platform Native Apps with Xamarin

Page, Layout, View

Page 32: Developing Cross-platform Native Apps with Xamarin

Pages

Page 33: Developing Cross-platform Native Apps with Xamarin

Layouts

Page 34: Developing Cross-platform Native Apps with Xamarin

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

Page 35: Developing Cross-platform Native Apps with Xamarin

Microsoft acquired Xamarin

Page 36: Developing Cross-platform Native Apps with Xamarin

Miguel de Icaza, Xamarin CTO

Page 37: Developing Cross-platform Native Apps with Xamarin

Automatically test your app on hundreds of real devices in the cloud

Page 38: Developing Cross-platform Native Apps with Xamarin

Xamarin Test Cloud – Testing Made Easy

Page 39: Developing Cross-platform Native Apps with Xamarin

What do I do all day?

Page 40: Developing Cross-platform Native Apps with Xamarin

• Develop web and mobile apps

• Xamarin experts• Founded in 1999• Microsoft technology stack

We advise on and build apps for business.

Page 41: Developing Cross-platform Native Apps with Xamarin

What We Do

a continuum of services from advisement to hands-on

Page 42: Developing Cross-platform Native Apps with Xamarin

Our Clients Include

and many small and medium-sized companies.

Page 43: Developing Cross-platform Native Apps with Xamarin

Our Proficiencies

•Web applications• Microsoft Technologies• C#, .NET, ASP.NET, MVC, HTML5,

Javascript

•Mobile apps• iOS, Android, Windows Phone• Built using Xamarin

Page 44: Developing Cross-platform Native Apps with Xamarin

MOBILE APPS IN THE WILD

(Case Studies)

Page 45: Developing Cross-platform Native Apps with Xamarin

        

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

Page 46: Developing Cross-platform Native Apps with Xamarin
Page 47: Developing Cross-platform Native Apps with Xamarin

Cross-platform

iOS Android

Page 48: Developing Cross-platform Native Apps with Xamarin

Feature-rich and Intuitive UI

Page 49: Developing Cross-platform Native Apps with Xamarin
Page 50: Developing Cross-platform Native Apps with Xamarin

          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

Page 51: Developing Cross-platform Native Apps with Xamarin

Thermo Cycler orPCR Device (polymerase chain reaction)for DNA Duplication

Page 52: Developing Cross-platform Native Apps with Xamarin

PCR Essentials

Page 53: Developing Cross-platform Native Apps with Xamarin

Internet of Things (IoT)Real-time Integration with Lab Devices

Page 54: Developing Cross-platform Native Apps with Xamarin
Page 55: Developing Cross-platform Native Apps with Xamarin

Federal Aviation Administration (FAA)

• Recreational drone use presents risks and threats

• FAA announcing new regulations

• Help drone flyers fly safely

Page 56: Developing Cross-platform Native Apps with Xamarin

B4UFLY

• Plan your trips• Airport locations• Controlled Airspace• Special Airspace• Flight Warnings• No-fly Zones

Page 57: Developing Cross-platform Native Apps with Xamarin

Xamarin gives us cross-platform reach

with native power and performance

Page 58: Developing Cross-platform Native Apps with Xamarin

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

Page 59: Developing Cross-platform Native Apps with Xamarin

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

Page 60: Developing Cross-platform Native Apps with Xamarin

Developing Cross-Platform Native Apps with

XamarinDan Hermes

developer, author, consultant, founder of Lexicon Systems

[email protected]

Available on Amazon

My blog: www.mobilecsharpcafe.com

Twitter: @danhermes