Native iOS, Android apps using Xamarin.Forms dotnetConf2016 Hyderabad

Preview:

Citation preview

Microsoft User Group Hyderabad

dotnetConf 2016 Hyderabad

iOS, Android, and Windows apps in C# and XAML with Xamarin.Forms

Pranav AinavoluMicrosoft MVP | Senior Developer – RealPage@a_pranav | http://pranavon.net/

Xamarin’s Unique Approach

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

Windows-specific C#

Android-specific C#

iOS-specificC#

C# Shared Logic

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

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

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

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.

AOT .APP

Visual Studio Integration

Anything you can do in Objective-C, Swift, or Javacan be done in C# and Visual Studio with Xamarin.

Visual Studio Integration

• Xamarin.com/Download

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

Meet Xamarin.Forms

Xamarin + Xamarin.Forms

Traditional Xamarin Approach

With Xamarin.Forms:More code-sharing, all

native

Windows-specific C#

Android-specific C#

iOS-specificC#

C# Shared Logic

Xamarin.Forms

C# Shared Logic

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

Xamarin.Forms

C# Shared Logic

Layouts

Pages

Stack Absolute Relative Grid ContentView

ScrollView

Frame

Content MasterDetail

Navigation

Tabbed Carousel

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

Xamarin.Forms Ecosystem

<?xml version="1.0" encoding="UTF-8"?><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

PlatformCustomization

Let’s take a look

Xamarin.Forms 2.0

✓ Windows 10 UWP✓ Control Templates✓ Data Template Selectors✓ More Gestures (Pinch & Pan)✓ XAML Compilation✓ Effects✓ Android Material Design

Xamarin.Forms

C# Shared Logic

• PDF, ePub, Kindle, iBooks, Google Play Books & More • By Charles Petzold

• http://bit.ly/xamarin-forms-book

Free Xamarin.Forms Book

Get Started TodayXamarin.com

<ThankYou />

© 2016 Microsoft Corporation. All rights reserved.

MUGH Facebook Pagehttp://fb.com/themugh

MUGH Twitterhttp://twitter.com/mughtwits

MUGH Bloghttp://mugh.net

Recommended