SlideShare une entreprise Scribd logo
1  sur  46
Télécharger pour lire hors ligne
www.bestppt.com
Xamarin
FROM ZERO TO HERO
29 september 2016
INTRODUCTIE
2
Gerald Versluis
@jfversluis
blog.verslu.is
gerald@verslu.is
INTRODUCTIE
3
Gerald Versluis
@jfversluis
blog.verslu.is
gerald@verslu.is
www.bestppt.com
XAMARIN: FROM ZERO TO HERO
Alles wat je nodig hebt om te beginnen met Xamarin development
Op de agenda…
5
1 Wat is Xamarin? Hoe onderscheidt Xamarin
zich van de rest?
Xamarin
2 Wat is Xamarin.Forms? Hoe werkt het? Wat
zijn de mogelijkheden?
Xamarin.Forms
3 DependencyService, Custom Renderers
Deep dive
4 Niet te missen NuGet packages voor het
ontwikkelen met Xamarin
NuGet Nuggets
5 Samenvatting, lessons learned, applaus en
borrelen!
It’s a wrap
www.bestppt.com
XAMARIN
Wat is dat nou eigenlijk?
Xamarin is a better way to…
7
Build Test Monitor
Verschillende manieren van ontwikkelen
8
Bouw dezelfde app meerdere keren
• Meerdere teams
• Meerdere code bases
• Verschillende tools en talen
silo/vendor
Verschillende manieren van ontwikkelen
9
Bouw één app voor alle platformen
• Grootste gemene deler
• Browser fragmentatie
• Cordova, PhoneGap
• Updates niet altijd via de App Store
hybride
Verschillende manieren van ontwikkelen
10
Bouw één app voor alle platformen
• Native User Interface
• Native Performance
• Gedeelde code over alle platformen
• C# & .NET Framework (inclusief C# 6.0!)
• Full API Coverage
Xamarin way
Waarom Xamarin?
11
Ontwikkel alles in C#

C# draait op 2,6 miljard apparaten
“
Waarom Xamarin?
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.
“
Native performance
Hoe doet Xamarin het?
13
.NET + Windows APIs
Hoe doet Xamarin het?
14
.NET + iOS APIs | 100% coverage
Hoe doet Xamarin het?
15
.NET + Android APIs | 100% coverage
Hoe gebruik je Xamarin?
16
Xamarin Studio
Windows of Mac
Visual Studio 2010+
Windows
Hoe gebruik je Xamarin?
17
Visual Studio
Alles werkt zoals je gewend bent
• Alle platformen in een solution
• Solution te openen in VS & XS
• Alle Visual Studio plug-ins te gebruiken
• iOS & Android designer
Hoe gebruik je Xamarin?
18
Xamarin Studio
Geoptimaliseerd voor cross-platform development
• Visual Studio kloon inclusief meeste belangrijke features
• iOS & Android designer
• Snelheid!
Xamarin apps te distribueren via App Stores
19
20
Anything you can do in Objective-C, Swift, or Java 

can be done in C# with Xamarin (using Visual Studio)
“
Enter Microsoft
21
Gratis
Open-source
live inspector
Insights -> HockeyApp
www.bestppt.com
Demo
www.bestppt.com
XAMARIN.FORMS
Nu met nog meer gedeelde code!
Wat is Xamarin.Forms?
24
Cross-platform UI framework
te gebruiken op:
• Android 4.0+
• iOS 6.1+
• Windows Phone 8.x
(Silverlight)
• Windows Phone 8.1 (RT)
• Windows 10 (UWP)
Traditionele Xamarin vs. Xamarin.Forms
25
Shared UI Code
Up to 99% code sharing,
always some specific
(initialisation) code.
60-80% code sharing
What’s included?
26
• 40+ Pages, Layouts en Controls
• Te gebruiken vanuit code of XAML
• Two-way Data Binding
• Navigation
• Animation API
• Dependency Service
• Messaging Center
“If you are used to MVVM
development you should feel
right at home
What’s included?
27
Pages
What’s included?
28
Layouts
What’s included? (worst slide ever…)
29
Controls
ActivityIndicator BoxView Button DatePicker Editor
Entry Image Label ListView Map
OpenGLView Picker ProgressBar SearchBar Slider
Stepper TableView TimePicker WebView EntryCell
ImageCell SwitchCell TextCell ViewCell
Xamarin.Forms in actie
30
Use a single API to generate native,
platform-specific user interfaces
At runtime, each Xamarin.Forms
page and its controls are mapped to
platform-specific native user
interface elements
“
“
Xamarin.Forms in actie
31
To Forms or not to Forms?
32
Xamarin.Forms best geschikt voor:
• Weinig platform specifieke
functionaliteit
• Code sharing over custom UI
• Ontwikkelaars met XAML kennis
Xamarin.iOS/Android best geschikt
voor:
• Veel platform specifieke
functionaliteit
• Custom UI over code sharing
• Veel gebruik van native APIs
Platform specifiek
33
Platform specifieke code uitvoeren
middels delegates
Kan gebruikt worden om per platform
een specifieke waarde te voorzien
Device.OnPlatform
Platform specifiek
34
Detecteren op welk besturingssysteem de app draait
of wat voor apparaat
Device
Ingebouwde platform specifieke features
35
Device.OpenUri

Openen van een URL
Page.DisplayAlert

Toont een messagebox
Device.StartTimer

Acties uitvoeren op interval
Device.BeginInvoke
OnMainThread
UI thread marshalling
Xamarin.Forms.Maps
Toont kaarten en locatiediensten
www.bestppt.com
Demonstratie
www.bestppt.com
Deep dive
Wat meer geavanceerde onderwerpen
DependencyService
38
Service locator maakt platform specifieke code mogelijk door abstractie
DependencyService
39
Implementeer de interface in het platform project
Registreer deze bij de DependencyService (boven namespace)
Roep abstractie aan vanuit gedeelde code
MyFirstEntry_Android
Xamarin.Platform.
Android.EntryRenderer
MyFirstEntry_iOS
Xamarin.Platform.
iOS.EntryRenderer
Custom Renderers
40
Maak je eigen implementatie van hoe een control naar native wordt vertaald
Entry MyFirstEntry
Xamarin.Platform.
Windows.EntryRenderer
MyFirstEntry_WinPhone
www.bestppt.com
NuGet Nuggets
Met deze NuGet packages wordt het ontwikkelen nóg makkelijker
NuGet packages die we allemaal zouden moeten gebruiken!
42
Xamarin.Plugins.Settings
Simple type (user) settings
Xamarin.Plugins.Connectivity
Network connectivity
ACR.UserDialogs
Alerts, loading, ActionSheets
FreshMvvm
Lightweight, easy to use MVVM framework
PropertyChanged.Fody
INotifyPropertyChanged made easy
FFImageLoading
Image caching, effects, etc.
Polly
Fluent exception handling
Refit
Type-safe REST library
Let op! Bij Forms vaak packages ook installeren
op platform project!
www.bestppt.com
It’s a wrap
Nog héél even volhouden…
Lessons learned
44
1 Do not underestimate publishing
2 Upgrading? Backup!
3
4
Test altijd op een fysiek apparaat
Weinig grip op je app in het wild
Leuk voor thuis
45
1
Xamarin documentatie
2
Xamarin forums
3
4
5
https://developer.xamarin.com/
https://forums.xamarin.com/
Xamarin GitHub
https://github.com/xamarin/
Planet Xamarin
http://planet.xamarin.com/
Xamarin University
https://www.xamarin.com/university
#schaamtelozezelfpromotie
46
Gerald Versluis
@jfversluis
blog.verslu.is
gerald@verslu.is
From Legislation to Organisation
Privacy by Design 101
17 November - Michel Gulpen

Contenu connexe

En vedette

Slide. Инструкция для новичков
Slide. Инструкция для новичковSlide. Инструкция для новичков
Slide. Инструкция для новичков
ellina-nik
 

En vedette (13)

EFC 2016_Final
EFC 2016_FinalEFC 2016_Final
EFC 2016_Final
 
Slide. Инструкция для новичков
Slide. Инструкция для новичковSlide. Инструкция для новичков
Slide. Инструкция для новичков
 
Para examen - Tema 1
Para examen - Tema 1Para examen - Tema 1
Para examen - Tema 1
 
Adlocum
AdlocumAdlocum
Adlocum
 
Build 2016 - B859 - The Future of Visual Studio
Build 2016 - B859 - The Future of Visual StudioBuild 2016 - B859 - The Future of Visual Studio
Build 2016 - B859 - The Future of Visual Studio
 
Enterprise Mobile Success with Oracle and Xamarin
Enterprise Mobile Success with Oracle and XamarinEnterprise Mobile Success with Oracle and Xamarin
Enterprise Mobile Success with Oracle and Xamarin
 
HockeyApp is not an app
HockeyApp is not an appHockeyApp is not an app
HockeyApp is not an app
 
Build 2016 - P542 - Windows Calls Applications
Build 2016 - P542 - Windows Calls ApplicationsBuild 2016 - P542 - Windows Calls Applications
Build 2016 - P542 - Windows Calls Applications
 
Props and costumes
Props and costumesProps and costumes
Props and costumes
 
SInar X
SInar XSInar X
SInar X
 
Xamarin Mobile Leaders Summit | Solving the Unique Challenges in Mobile DevOps
Xamarin Mobile Leaders Summit | Solving the Unique Challenges in Mobile DevOpsXamarin Mobile Leaders Summit | Solving the Unique Challenges in Mobile DevOps
Xamarin Mobile Leaders Summit | Solving the Unique Challenges in Mobile DevOps
 
How to be successful running Docker in Production
How to be successful running Docker in ProductionHow to be successful running Docker in Production
How to be successful running Docker in Production
 
презентація кільчасті черви.Pptx
презентація  кільчасті черви.Pptxпрезентація  кільчасті черви.Pptx
презентація кільчасті черви.Pptx
 

Similaire à Xamarin: From Zero to Hero: KEMBIT Meetup 29 september 2016

Innoveren met apps?, 27/05/2013
Innoveren met apps?, 27/05/2013Innoveren met apps?, 27/05/2013
Innoveren met apps?, 27/05/2013
Flevum
 
FEX | RoundTable | 132705 | Workshop: Innoveren met apps? | Presentatie | Mic...
FEX | RoundTable | 132705 | Workshop: Innoveren met apps? | Presentatie | Mic...FEX | RoundTable | 132705 | Workshop: Innoveren met apps? | Presentatie | Mic...
FEX | RoundTable | 132705 | Workshop: Innoveren met apps? | Presentatie | Mic...
Flevum
 
Toekomst Fork CMS
Toekomst Fork CMSToekomst Fork CMS
Toekomst Fork CMS
Fork-CMS
 
120214 fabrice mous oorsprong duiding toepassing oss
120214 fabrice mous   oorsprong duiding toepassing oss120214 fabrice mous   oorsprong duiding toepassing oss
120214 fabrice mous oorsprong duiding toepassing oss
CvO-ECABO
 
Devnology Community Day
Devnology Community DayDevnology Community Day
Devnology Community Day
boonzaai
 

Similaire à Xamarin: From Zero to Hero: KEMBIT Meetup 29 september 2016 (20)

Bouwstenen voor een moderne webapplicatie
Bouwstenen voor een moderne webapplicatieBouwstenen voor een moderne webapplicatie
Bouwstenen voor een moderne webapplicatie
 
Bouw cross-platform mobiele apps met PhoneGap
Bouw cross-platform mobiele apps met PhoneGapBouw cross-platform mobiele apps met PhoneGap
Bouw cross-platform mobiele apps met PhoneGap
 
Cmsselectie 2012
Cmsselectie 2012Cmsselectie 2012
Cmsselectie 2012
 
Html5 App
Html5 AppHtml5 App
Html5 App
 
Apps voor mobiele toestellen
Apps voor mobiele toestellenApps voor mobiele toestellen
Apps voor mobiele toestellen
 
Innoveren met apps?, 27/05/2013
Innoveren met apps?, 27/05/2013Innoveren met apps?, 27/05/2013
Innoveren met apps?, 27/05/2013
 
FEX | RoundTable | 132705 | Workshop: Innoveren met apps? | Presentatie | Mic...
FEX | RoundTable | 132705 | Workshop: Innoveren met apps? | Presentatie | Mic...FEX | RoundTable | 132705 | Workshop: Innoveren met apps? | Presentatie | Mic...
FEX | RoundTable | 132705 | Workshop: Innoveren met apps? | Presentatie | Mic...
 
Cms
CmsCms
Cms
 
Fork CMS Iphone app
Fork CMS Iphone appFork CMS Iphone app
Fork CMS Iphone app
 
Toekomst Fork CMS
Toekomst Fork CMSToekomst Fork CMS
Toekomst Fork CMS
 
Oorsprong, Duiding en Toepassing van Open Source Software (DOS II versie)
Oorsprong, Duiding en Toepassing van Open Source Software (DOS II versie)Oorsprong, Duiding en Toepassing van Open Source Software (DOS II versie)
Oorsprong, Duiding en Toepassing van Open Source Software (DOS II versie)
 
120214 fabrice mous oorsprong duiding toepassing oss
120214 fabrice mous   oorsprong duiding toepassing oss120214 fabrice mous   oorsprong duiding toepassing oss
120214 fabrice mous oorsprong duiding toepassing oss
 
BiMserver
BiMserverBiMserver
BiMserver
 
Wawwa build your artist portfolio site
Wawwa build your artist portfolio siteWawwa build your artist portfolio site
Wawwa build your artist portfolio site
 
SAP Fiori / UI5 expert forum 24-1-2017
SAP Fiori / UI5 expert forum 24-1-2017SAP Fiori / UI5 expert forum 24-1-2017
SAP Fiori / UI5 expert forum 24-1-2017
 
Devnology Community Day
Devnology Community DayDevnology Community Day
Devnology Community Day
 
PfCongrez 2007 Zend Studio Overview
PfCongrez 2007 Zend Studio OverviewPfCongrez 2007 Zend Studio Overview
PfCongrez 2007 Zend Studio Overview
 
PaaS: Platform as a Service
PaaS: Platform as a ServicePaaS: Platform as a Service
PaaS: Platform as a Service
 
Kennissessie Mobile
Kennissessie MobileKennissessie Mobile
Kennissessie Mobile
 
Gastles Linux BAC ROC Kop van Noord-Holland 19-03-2009
Gastles Linux BAC ROC Kop van Noord-Holland 19-03-2009Gastles Linux BAC ROC Kop van Noord-Holland 19-03-2009
Gastles Linux BAC ROC Kop van Noord-Holland 19-03-2009
 

Plus de Gerald Versluis

Plus de Gerald Versluis (6)

Creating airplane mode proof (Xamarin) applications
Creating airplane mode proof (Xamarin) applicationsCreating airplane mode proof (Xamarin) applications
Creating airplane mode proof (Xamarin) applications
 
Building 5 star apps with Xamarin Test Cloud at Techorama 2017
Building 5 star apps with Xamarin Test Cloud at Techorama 2017Building 5 star apps with Xamarin Test Cloud at Techorama 2017
Building 5 star apps with Xamarin Test Cloud at Techorama 2017
 
Building 5 star review apps with Xamarin Test Cloud
Building 5 star review apps with Xamarin Test CloudBuilding 5 star review apps with Xamarin Test Cloud
Building 5 star review apps with Xamarin Test Cloud
 
Session dotNed Saturday 28 januari 2017
Session dotNed Saturday 28 januari 2017Session dotNed Saturday 28 januari 2017
Session dotNed Saturday 28 januari 2017
 
Playtime is over: building real apps with Xamarin.Forms
Playtime is over: building real apps with Xamarin.FormsPlaytime is over: building real apps with Xamarin.Forms
Playtime is over: building real apps with Xamarin.Forms
 
The circle of life: ALM for your Xamarin app with VSTS and HockeyApp
The circle of life: ALM for your Xamarin app with VSTS and HockeyAppThe circle of life: ALM for your Xamarin app with VSTS and HockeyApp
The circle of life: ALM for your Xamarin app with VSTS and HockeyApp
 

Xamarin: From Zero to Hero: KEMBIT Meetup 29 september 2016