Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
James
Montemagno
Developer Evangelist, Xamarin
james@xamarin.com http://motzcod.es @JamesMontemagno
DESIGN – DEVELOP -‐ INTEGRATE TEST MONITOR
LEARN
Native User Interfaces Native API Access Native Performance
? ? ?
-John Gruber
http://daringfireball.net/2015/05/facebook_instant_articles
iOS WindowsAndroid
Objective-C
Xcode
C#
Visual Studio
Java
AndroidStudio
No shared code • Many languages & development env...
App Generator
Lua
Javascript
Actionscript
HTML+CSS
Limited native API access • Slow performance • Poor user experience
Shared C# codebase • 100% native API access • High performance
iOS C# UI Windows C# UIAndroid C# UI
Shared C# Mobile
Shared F# codebase • 100% native API access • High performance
iOS F# UI Windows F# UIAndroid F# UI
Shared F# Mobile
Microsoft.Phone Microsoft.Networking Windows.Storage Windows.Foundation Microsoft.Devices
System.Data System.Windows Syste...
MapKit UIKit iBeacon CoreGraphics CoreMotion
System.Data System.Windows System.Numerics System.Core System.ServiceModel
Sy...
Text-to-speech ActionBar Printing Framework Renderscript NFC
System.Data System.Windows System.Numerics System.Core System...
Xamarin.iOS does full Ahead Of Time
(AOT) compilation to produce an ARM
binary for Apple’s App Store.
Xamarin.Android take...
✓Always Up-to-Date
•
•
•
•
•
•
•
•
•
•
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%
...
Traditional Xamarin
Approach
With Xamarin.Forms:
More code-sharing, all native
iOS C# UI Windows C# UIAndroid C# UI
Shared...
✓ 40+ Pages, layouts, and controls
(Build from code behind or XAML)
✓ Two-way data binding
✓ Navigation
✓ Animation API
✓ ...
Which Xamarin approach is
best for your app?
Xamarin.Forms is best for: Xamarin.iOS / Xamarin.Android is best for:
• Data ...
<?xml version="1.0"  encoding="UTF-­‐8"?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schema...
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 ...
Xamarin.Forms Ecosystem
Windows Xamarin.Forms
StackPanel StackLayout
TextBox Entry
ListBox ListView
CheckBox Switch
ProgressBar ActivityIndicator
...
Windows Xamarin.Forms
DataContext BindingContext
{Binding Property} {Binding Property}
ItemsSource ItemsSource
ItemTemplat...
Shared C# Backend
What if we didn’t have to
write this code?
What if we could access
it from shared code?
UI+APIs UI + APIsUI + APIs
Battery...
TextToSpeech
Speak(“Hello World”);
AVSpeechSynthesizer SpeechSynthesizer
Common API
Get Started Today
xamarin.com
xamarin.com/university
Unrivaled Mobile
Development
Training
Live unlimited mobile development training from
mobile expert...
https://github.com/jamesmontemagno/TripExpenses.Forms
http://tryappservice.azure.com
https://components.xamarin.com/view/a...
Thank you.
James
Montemagno
Developer Evangelist, Xamarin
james@xamarin.com http://motzcod.es @JamesMontemagno
Questions?
Deep Dive in Xamarin.Forms
Deep Dive in Xamarin.Forms
Deep Dive in Xamarin.Forms
Deep Dive in Xamarin.Forms
Deep Dive in Xamarin.Forms
Deep Dive in Xamarin.Forms
Deep Dive in Xamarin.Forms
Deep Dive in Xamarin.Forms
Deep Dive in Xamarin.Forms
Deep Dive in Xamarin.Forms
Deep Dive in Xamarin.Forms
Deep Dive in Xamarin.Forms
Upcoming SlideShare
Loading in …5
×

Deep Dive in Xamarin.Forms

837 views

Published on

Chicago Coder Conference 2015

Building cross-platform native UIs with one shared codebase was once just a dream. With Xamarin.Forms, this dream is now a reality. Xamarin.Forms allows you to build a native UI for three platforms with one shared C# codebase. Simply put, if you know C# then you already know how to build iOS, Android, and Windows Phone apps. Leverage the .NET Framework to build out your shared business logic including integration with web services and Azure Mobile Services and then build out your shared UI in
C# or XAML. Xamarin.Forms also features a built-in two-way data binding, dependency service to help you implement platform-specific code, an advanced cross-platform animation system, support for custom controls, and lots of other powerful features to help you build the best apps possible in the least amount of time.

During this session we will cover the Xamarin platform and the brand new Xamarin.Forms library to share even more code across iOS, Android, and Windows Phone. Moreover, we will really focus on the code with several live coding adventures throughout the entire session. When you leave you will have the knowledge to create your first iOS, Android, and Windows Phone mobile apps in C# with Xamarin and Xamarin.Forms.

Published in: Engineering
  • Be the first to comment

Deep Dive in Xamarin.Forms

  1. 1. James Montemagno Developer Evangelist, Xamarin james@xamarin.com http://motzcod.es @JamesMontemagno
  2. 2. DESIGN – DEVELOP -‐ INTEGRATE TEST MONITOR LEARN
  3. 3. Native User Interfaces Native API Access Native Performance ? ? ?
  4. 4. -John Gruber http://daringfireball.net/2015/05/facebook_instant_articles
  5. 5. iOS WindowsAndroid Objective-C Xcode C# Visual Studio Java AndroidStudio No shared code • Many languages & development environments • Multiple teams
  6. 6. App Generator Lua Javascript Actionscript HTML+CSS Limited native API access • Slow performance • Poor user experience
  7. 7. Shared C# codebase • 100% native API access • High performance iOS C# UI Windows C# UIAndroid C# UI Shared C# Mobile
  8. 8. Shared F# codebase • 100% native API access • High performance iOS F# UI Windows F# UIAndroid F# UI Shared F# Mobile
  9. 9. 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
  10. 10. MapKit UIKit iBeacon CoreGraphics CoreMotion System.Data System.Windows System.Numerics System.Core System.ServiceModel System.Net System System.IO System.Linq System.Xml
  11. 11. 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
  12. 12. 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# Compile and Link .APK Bindings Runs Natively IL + JIT
  13. 13. ✓Always Up-to-Date • • • • • • • • • •
  14. 14. 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%
  15. 15. Traditional Xamarin Approach With Xamarin.Forms: More code-sharing, all native iOS C# UI Windows C# UIAndroid C# UI Shared C# Backend Xamarin.Forms Shared C# Backend
  16. 16. ✓ 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
  17. 17. 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
  18. 18. <?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>
  19. 19. Layouts Pages Stack Absolute Relative Grid ContentView ScrollView Frame Content MasterDetail Navigation Tabbed Carousel
  20. 20. ActivityIndicator BoxView Button DatePicker Editor Entry Image Label ListView Map OpenGLView Picker ProgressBar SearchBar Slider Stepper TableView TimePicker WebView EntryCell ImageCell SwitchCell TextCell ViewCell
  21. 21. Xamarin.Forms Ecosystem
  22. 22. Windows Xamarin.Forms StackPanel StackLayout TextBox Entry ListBox ListView CheckBox Switch ProgressBar ActivityIndicator Grid Grid Label Label Button Button Image Image Date/TimePicker Date/TimePicker
  23. 23. Windows Xamarin.Forms DataContext BindingContext {Binding Property} {Binding Property} ItemsSource ItemsSource ItemTemplate ItemTemplate DataTemplate DataTemplate
  24. 24. Shared C# Backend
  25. 25. What if we didn’t have to write this code? What if we could access it from shared code? UI+APIs UI + APIsUI + APIs Battery GPS Lights Notifications Settings Text To Speech Battery GPS Lights Notifications Settings Text To Speech Battery GPS Lights Notifications Settings Text To Speech
  26. 26. TextToSpeech Speak(“Hello World”); AVSpeechSynthesizer SpeechSynthesizer
  27. 27. Common API
  28. 28. Get Started Today xamarin.com
  29. 29. 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.
  30. 30. https://github.com/jamesmontemagno/TripExpenses.Forms http://tryappservice.azure.com https://components.xamarin.com/view/azure-mobile-services http://github.com/xamarin/plugins http://developer.xamarin.com
  31. 31. Thank you. James Montemagno Developer Evangelist, Xamarin james@xamarin.com http://motzcod.es @JamesMontemagno Questions?

×