Upload
craig-dunn
View
703
Download
1
Embed Size (px)
Citation preview
Craig Dunn@conceptdev
Xamarin.Forms 2.x
Why Xamarin?
Thousands of iOS and Android APIs
Public web APIs
Backend integrations
Third party libraries
Memory, CPU and network constraints
App Complexity
Write Everything in C#C# Now Runs on 2.6+ Billion
Devices
“With Xamarin, developers combine all of the productivity benefits of C#, Visual Studio and Windows Azure with the flexibility to quickly build for multiple device targets.”
Microsoft and Xamarin
S. Somasegar, Corporate Vice President, Microsoft
Anything you can do in Objective-C, Swift, or Javacan be done in C# and Visual Studio 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.
Xamarin’s Unique Approach
Shared C# codebase • 100% native API access • High performance
iOS C# UI
Windows C# UIAndroid C# UI
Shared C# Mobile
C# Server
Linux/MonoCoreCLRAzure
Shared C# Client/Server
Code SharingStatsMac
iOS
Android
Windows Phone
iCircuit
Touch Draw
86%
14%
72%
28%
70%
30%
61%
39%
88%
12%
76%
24%
90%
10%
Build native UIs for iOS, Android, Windows, and Windows Phone from a single, shared C# codebase.
Meet Xamarin.Forms
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
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✓ Effects✓ Templating✓ Windows 10 (UWP) and more to come…
Shared C# Backend
Shared UI Code
<?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
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
Other open-source librariesCocosSharp – game engineUrhoSharp – 3D graphics, 2D graphics, & gamesSkiaSharp – 2D graphics
Xamarin.Forms Ecosystem
Xamarin.Forms 2.x
Xamarin.Forms 2.0
✓ XAML compilation✓ Android AppCompat✓ ListViewCachingStrategy✓ PanGestureRecognizer
joins Tap and Pinch ✓ Windows 10 (UWP) Preview in addition to WinRT
XAML Compilation
✓ Surface mark up errors at compile time✓ Improves performance✓ Opt-in (may change)
[assembly:XamlCompilation (XamlCompilationOptions.Compile)]
https://developer.xamarin.com/guides/xamarin-forms/platform-features/android/appcompat/
Android AppCompat
ListViewCachingStrategy
✓ Improves scrolling performance✓ Old behaviour is currently the default (but likely to change)
Windows Support✓ WinRT APIs for Windows Phone 8.1✓ WinRT APIs for Windows 8.1✓ Universal Windows Platform for Windows 10
X Windows Phone 8 (Silverlight) will be deprecated
Xamarin.Forms 2.1✓ Control Templates✓ DataTemplateSelector✓ Effects
X BindableProperty.Create<TDeclarer,TPropertyType> has been deprecated
Control Templates I
Control Templates II
Data Templates
Effects I✓ Custom renderer “lite”✓ Change properties on the native control✓ Optional✓ “stringly-typed”
X No methods or eventsX No replacing the control
Effects IIentry.Effects.Add (Effect.Resolve ("Xamarin.BorderEffect"));
Xamarin.Forms vNext
Xamarin – Your Complete Mobile Solution
DESIGN – DEVELOP - INTEGRATE
TEST MONITOR
LEARN
Get Started Todayxamarin.com