cross platform mobile development with xamarin and office 365

32
Cross-Platform Mobile Development with Xamarin and Office 365 + Rob Ringham

Upload: soho-dragon

Post on 16-Apr-2017

644 views

Category:

Business


5 download

TRANSCRIPT

Page 1: Cross platform mobile development with xamarin and office 365

Cross-Platform Mobile Development withXamarin and Office 365

+

Rob Ringham

Page 2: Cross platform mobile development with xamarin and office 365

Rob RinghamArchitect & Mobile Expert at Infusion

twitter.com/robringham

linkedin.com/in/robringham

github.com/rringham

medium.com/@robringham

[email protected]

Page 3: Cross platform mobile development with xamarin and office 365
Page 4: Cross platform mobile development with xamarin and office 365

Agenda• What is Xamarin?• Why use it?• Alternatives: traditional native development,

PhoneGap, Ionic, Appcelerator, Telerik, etc…• Xamarin / Office 365 Integration

• Demo• How to get started• Questions

Page 5: Cross platform mobile development with xamarin and office 365

What is Xamarin?• Xamarin Platform

• Xamarin.iOS, Xamarin.Android, Xamarin.Mac (& more)

• Xamarin Forms• Xamarin Services

• Xamarin Component Store• Xamarin Test Cloud• Xamarin Insights

Page 6: Cross platform mobile development with xamarin and office 365

Xamarin Platform• Cross-platform mobile development

• Code sharing across multiple mobile platforms(C#, F#)

• Native user interfaces• Native API access• Native performance

Page 7: Cross platform mobile development with xamarin and office 365

Xamarin Platform• Xamarin.iOS: app C# code ahead-of-time

(AOT) compiled to ARM assembly (including subset of .NET framework)

• Xamarin.Android: app C# compiled to IL, packaged with MonoVM + JIT’ed, running side-by-side with Java/Android runtime

• Windows Phone: app runs under standard .NET Framework

Page 8: Cross platform mobile development with xamarin and office 365

Development Environment

IDE Support

• Xamarin Studio on OS X (uses VS solution /project format)

• Visual Studio on WindowsApp Build & Packaging Process

• iOS: leverages Apple iOS tooling on OS X• Android: leverages Google Android tooling

on Windows / OS X*iOS Visual Studio support requires a paired OS X machine

Page 9: Cross platform mobile development with xamarin and office 365

Xamarin.iOS• Apple’s iOS frameworks available

through .NET / C#• Platform SDK access accomplished via

Xamarin iOS bindings• Xamarin iOS bindings can be used to wrap

Objective-C / Swift code

Page 10: Cross platform mobile development with xamarin and office 365

Xamarin.iOS• UI built same as in traditional iOS native

development: with storyboards, XIBs / NIBs, code

• Xamarin iOS Designer or Xcode Interface Builder

• Similar development workflow (to traditional iOS native development)• MVC• Auto Layout / Device Size Classes• Outlets / Actions

*Excluding Xamarin Forms

Page 11: Cross platform mobile development with xamarin and office 365

Xamarin.Android• Google’s Android frameworks available

through .NET / C#• Xamarin Java binding libraries can be created

to wrap Java libraries

Page 12: Cross platform mobile development with xamarin and office 365

Xamarin.Android• UI built same as in traditional Android native

development: Android Layout files, Resources• Xamarin Designer or Android Studio• Similar development workflow (to traditional

Android native development)

• Activities• Intents

*Excluding Xamarin Forms

Page 13: Cross platform mobile development with xamarin and office 365

Managed wrappers for native controls

Page 14: Cross platform mobile development with xamarin and office 365

Why use Xamarin?Foundation

• Single language (C# / F#) for cross-platform mobile development

• Mature technology foundation: .NET Framework (& Mono)

Acceleration

• Code sharing across mobile platforms

• Sharing UI logic across mobile platforms*

• NuGet / Xamarin Component Store

Quality

• Native performance, native user experience

• Unit testing shared code

• UI automation testing

*with Xamarin Forms

Page 15: Cross platform mobile development with xamarin and office 365

Code Sharing• Shared code contained within Portable Class

Libraries (PCLs)• PCLs support multiple .NET Framework

platforms• PCL projects target specific profiles that

support a known set of BCL classes/features

• Native app assemblies reference shared PCLs

Page 16: Cross platform mobile development with xamarin and office 365

Code Sharing

Page 17: Cross platform mobile development with xamarin and office 365

Alternatives to Xamarin

Page 18: Cross platform mobile development with xamarin and office 365

Mobile Platforms: Comparison

Xamarin Traditional Native React Native PhoneGap / Hybrid Titanium Kony / Telerik / etc.

Native apps / UI / performance Yes Yes Yes No No No

Languages C# / F# Swift, Objective-C,Java JavaScript JavaScript JavaScript JavaScript

Cross-platform Code Sharing Yes No Yes Yes Yes Yes

Active Developer Community* Yes Yes No Yes No No

Commercially Licensed Yes No No No Yes Yes

xamarin swift react-native cordova titanium kony

Tagged on StackOverflow 9,472 61,572 1,083 38,886 1,637 64

Page 19: Cross platform mobile development with xamarin and office 365

Xamarin: Downsides• License costs• Memory management can be challenging,

particularly on iOS• iOS: Profiling tooling limited compared to

traditional native development with Instruments• Select Instruments tools still work with

Xamarin.iOS apps, though

Page 20: Cross platform mobile development with xamarin and office 365

Xamarin: Upsides• Standardized language (C#) across multiple

platforms• .NET Framework• NuGet• Shared Code Unit Testing• Async / Await• Xamarin Studio refactoring tools (or VS, if you

prefer)

Page 21: Cross platform mobile development with xamarin and office 365

Xamarin + Office 365

Page 22: Cross platform mobile development with xamarin and office 365

Demo App: High Level Architecture

Windows Azure Active Directory

Office 365Business

Subscription

Office 365

Unified API

Xamarin FormsApp (Shared

Code)

iOS App

Android App

Authenticates against

REST requests

Manages permissions

Page 23: Cross platform mobile development with xamarin and office 365

Demo App: Quick Links

• Office 365 Portal: https://portal.office.com• Azure AD Graph API Explorer:

https://graphexplorer2.azurewebsites.net• Example Requests:

• https://graph.microsoft.com/beta/me/messages• https://graph.microsoft.com/beta/me/calendar/events

Page 24: Cross platform mobile development with xamarin and office 365

Xamarin Forms• Xamarin Forms

• Native UI, shared codebase (up to 90% shared)

• Ideal for data entry, LOB apps• Platform-specific custom rendering of

controls possible• Everything else besides choice UI

framework still works “the Xamarin Way” - native UI, full native API access, native performance, etc…

Page 25: Cross platform mobile development with xamarin and office 365

Xamarin Forms• UI with Xamarin Forms

• Code based, XAML based• Adapts to target platform and target device

(e.g. phone vs. tablet)• No Auto Layout!• Various app page structures & layouts to

work with

Page 26: Cross platform mobile development with xamarin and office 365
Page 27: Cross platform mobile development with xamarin and office 365

Xamarin Forms

Page 28: Cross platform mobile development with xamarin and office 365

Demo

Page 29: Cross platform mobile development with xamarin and office 365

Demo Code

Full demo app available on GitHub

• iOS + Android support• github.com/rringham/XamarinOffice365• BYOCID

• “Bring your own Client ID”

Page 30: Cross platform mobile development with xamarin and office 365

How to get startedwith Xamarin

Page 31: Cross platform mobile development with xamarin and office 365

Getting Started• 30 day free trial of Xamarin Business (link)• Xamarin Resources

• Getting Started (link)• Introduction to Xamarin Forms (link)

• Office 365• Unified API Preview (link)

Page 32: Cross platform mobile development with xamarin and office 365

Questions?