introduction to cross platform mobile apps (xamarin)

45
Sponsored & Brought to you by Cross Platform Mobile Applications in C# with Sivanraj M Senior Software Engineer, BizTalk360 https://twitter.com/sivanrajm https://in.linkedin.com/in/sivanrajm

Upload: biztalk360

Post on 13-Feb-2017

341 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Introduction to Cross Platform Mobile Apps (Xamarin)

Sponsored & Brought to you by

Cross Platform Mobile Applications in C# with

Sivanraj M Senior Software Engineer, BizTalk360

https://twitter.com/sivanrajmhttps://in.linkedin.com/in/sivanrajm

Page 2: Introduction to Cross Platform Mobile Apps (Xamarin)

Xamarin – Your Complete Mobile Solution

Page 3: Introduction to Cross Platform Mobile Apps (Xamarin)

Develop

Page 4: Introduction to Cross Platform Mobile Apps (Xamarin)

Silo Approach

iOS WindowsAndroid

Objective-CXcode

C#Visual Studio

JavaAndroid Studio

No shared code • Many languages & development environments • Multiple teams

Page 5: Introduction to Cross Platform Mobile Apps (Xamarin)

Write Once, Run Anywhere

App Generator

LuaJavascript

ActionscriptHTML+CSS

Limited native API access • Slow performance • Poor user experience

Page 6: Introduction to Cross Platform Mobile Apps (Xamarin)

Xamarin’s Unique Approach

Shared C# codebase • 100% native API access • High performance

iOS C# UI

Windows C# UIAndroid C# UI

Shared C# Mobile

Page 7: Introduction to Cross Platform Mobile Apps (Xamarin)

Windows APIs

Microsoft.Phone Microsoft.Networking

Windows.Storage

Windows.Foundation

Microsoft.Devices

System.Data System.Windows

System.Numerics System.Core System.ServiceMod

el

System.Net System System.IO System.Linq System.Xml

Page 8: Introduction to Cross Platform Mobile Apps (Xamarin)

iOS – 100% API Coverage

MapKit UIKit iBeacon CoreGraphics CoreMotion

System.Data System.Windows

System.Numerics System.Core System.ServiceMod

el

System.Net System System.IO System.Linq System.Xml

Page 9: Introduction to Cross Platform Mobile Apps (Xamarin)

Android – 100% API Coverage

Text-to-speech ActionBar Printing Framework Renderscript NFC

System.Data System.Windows

System.Numerics System.Core System.ServiceMod

el

System.Net System System.IO System.Linq System.Xml

Page 10: Introduction to Cross Platform Mobile Apps (Xamarin)

TextToSpeech

Speak(“Hello World”);

AVSpeechSynthesizer SpeechSynthesizer

Page 11: Introduction to Cross Platform Mobile Apps (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 12: Introduction to Cross Platform Mobile Apps (Xamarin)

Extensibility

Embed Custom Views Anywhere

Not only are Xamarin.Forms pages mixable with custom screens, you can embed custom views built directly against Xamarin.iOS and Xamarin.Android into Xamarin.Forms pages.

Call Platform APIs via Shared Services

Need platform-specific functionality within a Xamarin.Forms page, such as querying the accelerometer? We’ve included services that quickly and easily abstract platform-specific API calls to keep you writing as much shared code as possible.

Easy migration to the Xamarin Platform

When your native platform integration requirements outgrow Xamarin.Forms, your shared code is easily migrated to Xamarin.iOS and Xamarin.Android using the full Xamarin platform.

Page 13: Introduction to Cross Platform Mobile Apps (Xamarin)

Visual Studio - Windows Xamarin Studio – Mac

Page 14: Introduction to Cross Platform Mobile Apps (Xamarin)

Visual Studio Integration

Page 15: Introduction to Cross Platform Mobile Apps (Xamarin)

Let’s take a look

Page 16: Introduction to Cross Platform Mobile Apps (Xamarin)

Build native UIs for iOS, Android, and Windows Phone from a single, shared C# codebase.

Meet Xamarin.Forms

Page 17: Introduction to Cross Platform Mobile Apps (Xamarin)

Xamarin + Xamarin.Forms

Traditional Xamarin Approach

With Xamarin.Forms:More code-sharing, all

native

iOS C# UI Windows C#

UIAndroid C# UI

Shared C# Backend

Shared UI Code

Shared C# Backend

Page 18: Introduction to Cross Platform Mobile Apps (Xamarin)

What’s included

✓ 40+ Pages, layouts, and controls (Build from code behind or XAML)✓ Two-way data binding✓ Navigation✓ Animation API✓ Dependency Service✓ Messaging Center

Shared C# Backend

Shared UI Code

Page 19: Introduction to Cross Platform Mobile Apps (Xamarin)

ActivityIndicator BoxView Button DatePicker Editor

Entry Image Label ListView Map

OpenGLView Picker ProgressBar SearchBar Slider

Stepper TableView TimePicker WebView EntryCell

ImageCell SwitchCell TextCell ViewCell

Controls

Page 20: Introduction to Cross Platform Mobile Apps (Xamarin)

Windows Xamarin.FormsStackPanel StackLayoutTextBox EntryListBox ListViewCheckBox SwitchProgressBar ActivityIndicatorGrid GridLabel LabelButton ButtonImage ImageDate/TimePicker Date/TimePicker

Control Comparison

Page 21: Introduction to Cross Platform Mobile Apps (Xamarin)

Windows Xamarin.FormsDataContext BindingContext{Binding Property}

{Binding Property}

ItemsSource ItemsSourceItemTemplate ItemTemplateDataTemplate DataTemplate

Binding Comparison

Page 22: Introduction to Cross Platform Mobile Apps (Xamarin)

Platform Customization

Page 23: Introduction to Cross Platform Mobile Apps (Xamarin)

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"

xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

x:Class="MyApp.MainPage">

<TabbedPage.Children>

<ContentPage Title="Profile" Icon="Profile.png">

<StackLayout Spacing="20" Padding="20“ VerticalOptions="Center">

<Entry Placeholder="Username" Text="{Binding Username}"/>

<Entry Placeholder="Password"

Text="{Binding Password}"

IsPassword="true"/>

<Button Text="Login" TextColor="White"

BackgroundColor="#77D065"

Command="{Binding LoginCommand}"/>

</StackLayout>

</ContentPage>

<ContentPage Title="Settings" Icon="Settings.png">

<!-- Settings -->

</ContentPage>

</TabbedPage.Children>

Native UI from shared code

Page 24: Introduction to Cross Platform Mobile Apps (Xamarin)

Let’s Take a Look

Page 25: Introduction to Cross Platform Mobile Apps (Xamarin)

Test

Page 26: Introduction to Cross Platform Mobile Apps (Xamarin)

On Mobile, Quality is Hard

52020356

OS versionsDevicesLanguagesLocalesScreen sizes

919K+395727156

OS versionsDistinct devicesLanguagesLocalesScreen sizesManufacturersScreen configurations

Page 27: Introduction to Cross Platform Mobile Apps (Xamarin)

Tap Scroll Swipe Pinch Multi Finger

Text Entry

Rotation GPS

Page 28: Introduction to Cross Platform Mobile Apps (Xamarin)

xamarin.com/testcloud

Page 29: Introduction to Cross Platform Mobile Apps (Xamarin)

Introducing Xamarin.UITest

Create Automated User Interface tests all in C#Upload to the Test Cloud or run against a Device or SimulatorRun directly from Visual Studio or Xamarin StudioFreely available for testing on a Simulator*Works on ANY app: Native, Hybrid, or Xamarin

Page 30: Introduction to Cross Platform Mobile Apps (Xamarin)

Test Recorder for Visual Studio

• Record UITests from Visual Studio

• Replay or ship to Test Cloud

• Use Touch Screen on Android Emulator

Page 31: Introduction to Cross Platform Mobile Apps (Xamarin)

Test Recorder for Mac• Record UITests for iOS and Android apps• Replay or ship to Test Cloud

Page 32: Introduction to Cross Platform Mobile Apps (Xamarin)

Device RemotingTests are performed one at the

time, which consumes more time and delays bugs

detection

Automated TestingTest on thousands of devices

simultaneously,saving lots of time and detecting

bugs more quickly

Approaches to Mobile Testing

Page 33: Introduction to Cross Platform Mobile Apps (Xamarin)

Build

Page 34: Introduction to Cross Platform Mobile Apps (Xamarin)

Visual Studio Team Services

• Code• Work• Build• Test• Release

Page 35: Introduction to Cross Platform Mobile Apps (Xamarin)

Visual Studio Team Services - Work

Page 36: Introduction to Cross Platform Mobile Apps (Xamarin)

Visual Studio Team Services - Build

Page 37: Introduction to Cross Platform Mobile Apps (Xamarin)

Visual Studio Team Services - Test

Page 38: Introduction to Cross Platform Mobile Apps (Xamarin)

Visual Studio Team Services - Release

Page 39: Introduction to Cross Platform Mobile Apps (Xamarin)

Distribute & Monitor

Page 40: Introduction to Cross Platform Mobile Apps (Xamarin)

MICROSOFT CONF IDENT IAL – INTERNAL ONLY

Xamarin InsightsAdding Intelligent Analytics and Crash Reporting to Your Apps.

Page 41: Introduction to Cross Platform Mobile Apps (Xamarin)

Xamarin Insights Dashboard

Page 42: Introduction to Cross Platform Mobile Apps (Xamarin)

Get Started Todayxamarin.com

Page 43: Introduction to Cross Platform Mobile Apps (Xamarin)

Free 30 Day Trial - xamarin.com/university

Unrivaled Mobile

Development Training

Live unlimited mobile development training from mobile experts, in your time-zone, on your schedule, and as often as you'd like.

Page 44: Introduction to Cross Platform Mobile Apps (Xamarin)

Code Samples - https://developer.xamarin.com/samples-all

Get up to speed with

Xamarin with our Resources

Learn how to build iOS, Android, and Windows Mobile apps with our web resources like webinars, code samples and videos.

Webinars - https://www.xamarin.com/resources/webinars

Videos - https://developer.xamarin.com/videos