Introduction to mobile
development with Xamarin
Anas EL HAJJAJI
Casablanca
Mobile .NET Developers Group
CasablancaMobileDevelopers
Saturday, Feb 11th, 2017
What do I need to deliver a
great mobile app?
What do I need to deliver a great mobile app?
Study
• Know Target OS (Android, iOS, Windows Phone …)
• Choose the architecture (hybride, native …)
• Choose the framework (Ionic, phonegap, Sencha, Xamarin ...)
• Company culture & technology learning curve
• Budget
What do I need to deliver a great mobile app?
Development
• Up to date SDK
■ Programming Language
■ IDE with UI Previewer and debugging possibility
■ Great documentation
• Third party libraries
• Active community (Github, Stack Overflow …)
• Backend
What do I need to deliver a great mobile app?
Test
• Unit Tests & Integration Tests
• UI Tests
Build & Distribute
• Continuous Integration (CI)
• Continuous Delivery (CD)
Monitor
• Crash reports & Analytics
So what’s Xamarin?
What’s Xamarin?
• Founded in May 2011, acquired by Microsoft in February 2016
• Native iOS, Android, Mac and Windows Mobile App development platform
• C# 6 as development language, initially based on Mono
• Same day support and always up to date
• Native characteristics
■ Native User Interface
■ Full SDK Access
■ Native Performance
“Xamarin's architectural approach
provides completely native UIs with better
performance than other cross-platform
techniques… Xamarin uses multifaceted
technology built by a cohesive team with a
solid long-term track record.”
Name
Title and Company
Gartner Strongly Endorses
Xamarin Technology
Gartner
August 2013
What’s Xamarin?
Complete Mobile Solution
Anything you can do natively you
should be able to do with
Xamarin.
Develop
Traditional Approach
iOS C# UI Windows C# UIAndroid C# UI
Shared C# Mobile
Develop
Xamarin.Forms Approach
Shared C# Mobile
Shared UI Code
Develop
Xamarin.Forms Approach
Shared C# Mobile
Shared UI Code
• 40+ pages, layouts and controls
• Two-way data binding
• Navigation
• Animation API
• Dependency Service
• Messaging Center
Develop
Xamarin.Forms Approach
Develop
Code in C# 6
• LINQ Support
• Events & Delegates
• Lambda expressions
• Async/await to make asynchronous programming pleasant
• Easy XML & JSON manipulation
Develop
Android APIs
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
Develop
iOS APIs
System.Data System.Windows System.Numerics System.Core System.ServiceModel
System.Net System System.IO System.Linq System.Xml
MapKit UIKit iBeacon CoreGraphics CoreMotion
Develop
Windows APIs
System.Data System.Windows System.Numerics System.Core System.ServiceModel
System.Net System System.IO System.Linq System.Xml
Microsoft.Phone
Microsoft.Networki
ng
Windows.Storage
Windows.Foundati
on
Microsoft.Devices
Develop
Visual Studio
Develop
Xamarin Studio
Develop
Android Designer
Develop
iOS Designer
Develop
XAML Designer
Develop
Xamarin Component Store
Develop
Xamarin Profiler
Develop
Xamarin Workbooks
Develop
Azure Mobile Apps
Free 30 Day 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.
And what if I already have a native
library, do I need to rewrite it?
Test
Challenges
• Device Fragmentation
• App Complexity
• Fast Release Cycles
• Short Sessions
• High Mobile User Expectations
Test
Quality is Hard
• 5 OS
• 20 Versions
• 20 Devices
• 35 Languages
• 6 Locales
• Screen sizes
• 9 OS versions
• 19k+ Distinct devices
• 39 Languages
• 57 Locales
• 27 Screen sizes
• 15 Manufacturers
• 6 Screen
configurations
Test
App Complexity
Thousands of iOS and Android APIs
Public web APIs
Backend integrations
Third party libraries
Memory, CPU and network constraints
Tap Scroll Swipe Pinch Multi Finger
Text Entry Rotation GPS
Test
Xamarin.UITest
Test
Test Recorder
GUIDELINES – DO NOT USE SLIDE
Build
Visual Studio Team Services
Build
Visual Studio Team Services (Build)
Build
Visual Studio Team Services (Test)
Build
Visual Studio Team Services (Release)
Distribute & Monitor
HockeyApp
Thank You!
Questions?
Anas EL HAJJAJI
Casablanca
Mobile .NET Developers Group
anas.elhajjaji@gmail.com
@anaselhajjaji
We’re here to help
@CasaMobileDev
CasablancaMobileDevelopers@gmail.com
https://www.meetup.com/fr-FR/CasablancaMobileDevelopers/
https://www.facebook.com/CasaMobileDev
https://plus.google.com/b/111408795852981067165

Xamarin introduction

Editor's Notes

  • #3 Who has a smartphone? Tablet? Android? iOS? Windows Phone? Studies shown that we use between 5-20 max, store size 3m, how many applications you use each day? Max 5, max 10, max 20? How my application be on the top 10 / 3m store apps. In the past, some bad misconceptions: use ijetty and develop a web app. Forget about web dev background, desktop dev background. Concentrate on mobile dev, different industry, different constraints. Who can answer the question?
  • #8 What makes up a “Native” mobile application? I am sure you have heard the “native” thrown around, but what does that really mean? A native app needs a lot of things, but three important ones stick out: Native User Interface: Apps need to look and act correct per platform. Full SDK Access: As a developer we need to add the latest and greatest features Native Performance: Needs to be fast and fluid Apple has a developer preview where Xamarin has alphas ready. Google does not offer this. Android versions are usually 4 to 8 weeks out for a stable release, but alphas and betas are usually earlier. Xamarin realizes how important having iOS ready because within 24 hours a large portion of iOS users upgrade Android on the other hand is much different. After 4 months on the market Android 4.4 only had 1% adoption
  • #9 You may not use the photo of Jessica; find your own quote author photos. Photo chang: PowerPoint doesn’t support drawing mask tools, so you need to send us your profile photo when you edit your slides. We will edit your photo for you! serena.zhang@xamarin.com
  • #10 Xamarin is your complete mobile solution. Xamarin Platform is usually what you hear about which is building native iOS, Android, Mac, and Windows Apps all in C# However Xamarin offers a wide range of products for developers to go mobile including Test Cloud, Hockey App, and a way to learn all of mobile with University.
  • #11 In a projet I developped in native: android, ios I did X, can I do it with Xamarin?
  • #13 UI build natively per platform, leveraging C# C# + XAML C# + XML C# + XIB One shared app logic code base, iOS, Android, Mac, Windows Phone, Windows Store, Windows
  • #14 Xamarin recently introduced Xamarin.Forms a new library for cross platform user interface. We will touch up on this later, but this enables you to be highly productive, share code, but build out UI on each platform and access platform APIs. With Xamarin.Forms you now have a nice Shared UI Code layer, but still access to platform APIs You can start from native, pick a few screens, or start with forms, and replace with native later
  • #22 Xamarin Studio on Mac offers: Android, iOS and Mac development World Class IDE with great features: Code Analysis Upload to Test Flight Git & Subversion Integration Code Completion Code Navigation Easy transition from Visual Studio The same Solution & Projects open in BOTH Xamarin Studio and Visual Studio!
  • #35 OpenSignal is a global app that publishes an annual report on Android device fragmentation based on the distinct Android device types that download their app. This is their August 2015 data, with an astonishing 24,000 device types using their app, up by 60% from just last year. Different device operating systems, form factors, screen sizes, resolutions, chip sets, and manufacturer modifications make it difficult to know that your app will work well on all devices https://opensignal.com/reports/2015/08/android-fragmentation/