Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building cross platform mobile applications using xamarin

Chris Key
September 28, 2016

Building cross platform mobile applications using xamarin

Second part in the Microsoft webcast series i presented: Cross platform mobile development using Xamarin. The second webcast will focus on two different approaches to cross platform development with Xamarin. The first approach will focus on creating a shared code base to maximize code re-use but still use native UI’s. The second approach will go a step further and shares UI between the different platforms.

You watch a recording of the webcast here:
https://info.microsoft.com/WE-VSO-WBNR-FY17-09Sep-28-Webinar-enterprise-app-development-part-2-244438_Registration.html

Chris Key

September 28, 2016
Tweet

More Decks by Chris Key

Other Decks in Programming

Transcript

  1. Series Part 1: Introduction to Xamarin mobile development September 14

    Part 2: Building Cross Platform Mobile Applications using Xamarin Today Part 3: Mobile Dev Ops powered by Xamarin and Microsoft October 12, 2016 – 11:00-12:00 CET
  2. • Developing cross platform more efficiently • Xamarin forms •

    Demo: Xamarin forms • Mvvmcross • Demo: Mvvmcross Agenda
  3. Demo app: XamLoc DEMO APP: Xamloc iOS http://tinyurl.com/hxyg5fl DEMO APP:

    XAMLOC Android http://tinyurl.com/jjcklb5 source for demo app https://github.com/chriskeynl/xamwebcasts
  4. Components that make up an app UI Dialogs / notifications

    Navigation Services Models Configuration files GPS Logic Meta data Localizations Caching Push notifications Storage Business rules Validators Background services Device specific hardware Additional XAMLOC
  5. Xamarin plugins UI+APIs UI + APIs UI + 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
  6. MVVM pattern View View Model Model The view is responsible

    for defining the structure, layout, and appearance of what the user sees on the screen with a limited code-behind that does not contain business logic. The view model acts as an intermediary between the view and the model, and is responsible for handling the view logic. The view model acts as an intermediary between the view and the model, and is responsible for handling the view logic.
  7. Shared code stats Code Sharing Stats Mac iOS Android Windows

    iCircuit Touch Draw 86% 14% 72% 28% 70% 30% 61% 39% 88% 12% 76% 24% 90% 10%
  8. Xamarin forms Traditional Xamarin Approach With Xamarin.Forms: More code-sharing, all

    native iOS C# UI Windows C# UI Android C# UI Shared C# Backend Shared UI Code Shared C# Backend
  9. ✓ 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
  10. ActivityIndicator BoxView Button DatePicker Editor Entry Image Label ListView Map

    OpenGLView Picker ProgressBar SearchBar Slider Stepper TableView TimePicker WebView EntryCell ImageCell SwitchCell TextCell ViewCell
  11. <?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>
  12. Mvvmcross • Native iOS, android and windows UI • Shared

    code base • mvvm pattern • plugins • Converters
  13. MVVM pattern View View Model Model The view is responsible

    for defining the structure, layout, and appearance of what the user sees on the screen with a limited code-behind that does not contain business logic. The view model acts as an intermediary between the view and the model, and is responsible for handling the view logic. The view model acts as an intermediary between the view and the model, and is responsible for handling the view logic.
  14. Plugins Accelerometer Bookmarks Color DownloadCache Email Field Binding File Json

    JsonLocalization Location Messenger MethodBinding Network PhoneCall PictureChooser ReflectionEx ResourceLoader ResxLocalization SQLite-PCL Share SoundEffects ThreadUtils Visibility ViewCell * Third Party WebBrowser