Introduction to Xamarin.Forms
-
Upload
james-montemagno -
Category
Documents
-
view
93 -
download
0
Transcript of Introduction to Xamarin.Forms
![Page 1: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/1.jpg)
![Page 3: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/3.jpg)
DESIGN – DEVELOP -‐ INTEGRATE TEST MONITOR
LEARN
![Page 4: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/4.jpg)
Shared C# codebase • 100% native API access • High performance
iOS C# UI Windows C# UIAndroid C# UI
Shared C# Mobile
![Page 5: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/5.jpg)
Microsoft.Phone Microsoft.Networking Windows.Storage Windows.Foundation Microsoft.Devices
System.Data System.Windows System.Numerics System.Core System.ServiceModel
System.Net System System.IO System.Linq System.Xml
![Page 6: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/6.jpg)
MapKit UIKit iBeacon CoreGraphics CoreMotion
System.Data System.Windows System.Numerics System.Core System.ServiceModel
System.Net System System.IO System.Linq System.Xml
![Page 7: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/7.jpg)
Text-to-speech ActionBar Printing Framework Renderscript NFC
System.Data System.Windows System.Numerics System.Core System.ServiceModel
System.Net System System.IO System.Linq System.Xml
![Page 8: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/8.jpg)
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.
.NET
C# Compileand Link .APK
Bindings
RunsNatively
IL+
JIT
![Page 9: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/9.jpg)
![Page 10: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/10.jpg)
✓Always Up-to-Date•••••
•••••
![Page 11: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/11.jpg)
![Page 12: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/12.jpg)
![Page 13: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/13.jpg)
Xamarin.iOS Xamarin.Android
![Page 14: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/14.jpg)
![Page 15: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/15.jpg)
![Page 16: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/16.jpg)
Mac
iOS
Android
Windows Phone
Calca iCircuit Touch Draw
86%
14%
72%
28%
77%
23%
70%30%
61%39%
94%
6%
88%
12%
76%
24%
90%
10%
![Page 17: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/17.jpg)
![Page 18: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/18.jpg)
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 19: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/19.jpg)
✓ 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 20: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/20.jpg)
Which Xamarin approach is best for your app?
Xamarin.Forms is best for: Xamarin.iOS / Xamarin.Android is best for:
• Data entry apps
• Prototypes and proofs-of-concept
• Apps that require little platform-specific functionality
• Apps where code sharing is more important than custom UI
Learn more: xamarin.com/forms Learn more: xamarin.com/platform
• Apps that require specialized interaction
• Apps with highly polished design
• Apps that use many platform-specific APIs
• Apps where custom UI is more important than code sharing
![Page 21: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/21.jpg)
<?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>
![Page 22: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/22.jpg)
Xamarin.FormsButton
ClickedText
Android Button
ClickedText
iOSUIButton
TouchUpInsideText
WindowsButton
ClickedContent
![Page 23: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/23.jpg)
Layouts
Pages
Stack Absolute Relative Grid ContentView ScrollView Frame
Content MasterDetail Navigation Tabbed Carousel
![Page 24: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/24.jpg)
ActivityIndicator BoxView Button DatePicker Editor
Entry Image Label ListView Map
OpenGLView Picker ProgressBar SearchBar Slider
Stepper TableView TimePicker WebView EntryCell
ImageCell SwitchCell TextCell ViewCell
![Page 25: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/25.jpg)
Xamarin.Forms Ecosystem
![Page 26: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/26.jpg)
Windows Xamarin.FormsStackPanel StackLayout
TextBox Entry
ListBox ListView
CheckBox Switch
ProgressBar ActivityIndicator
Grid Grid
Label Label
Button Button
Image Image
Date/TimePicker Date/TimePicker
![Page 27: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/27.jpg)
Windows Xamarin.Forms
DataContext BindingContext
{Binding Property} {Binding Property}
ItemsSource ItemsSource
ItemTemplate ItemTemplate
DataTemplate DataTemplate
![Page 28: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/28.jpg)
![Page 29: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/29.jpg)
![Page 30: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/30.jpg)
![Page 31: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/31.jpg)
Shared C# Backend
![Page 32: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/32.jpg)
What if we didn’t have to write this code?
What if we could access it from shared code?
UI+APIs UI + APIsUI + APIs
BatteryGPSLightsNotificationsSettingsText To Speech
BatteryGPSLightsNotificationsSettingsText To Speech
BatteryGPSLightsNotificationsSettingsText To Speech
![Page 33: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/33.jpg)
TextToSpeech
Speak(“Hello World”);
AVSpeechSynthesizer SpeechSynthesizer
![Page 34: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/34.jpg)
Common API
![Page 35: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/35.jpg)
![Page 36: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/36.jpg)
Get Started Todayxamarin.com
![Page 37: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/37.jpg)
Free 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 38: Introduction to Xamarin.Forms](https://reader038.fdocuments.in/reader038/viewer/2022102807/55b93d55bb61ebba7d8b468b/html5/thumbnails/38.jpg)
Thank you.
JamesMontemagnoDeveloper Evangelist, Xamarin
[email protected] motzcod.es @JamesMontemagno
Questions?