Xamarin písanie Android a ios aplikácií v C#

Similar documents
Chris Key. Senior Consultant. Open Circle Solutions

We re here to help. Erik Polzin. Colby Williams. Engineer Partner Team. Director Partners and Channels. +1 (415)


4/25/ Xamarin. All rights reserved.

Come and Get Excited about Azure Mobile Services and Xamarin.Forms

Razvoj multiplatformskih mobilnih aplikacija sa Xamarin Forms. Andrej Radinger, MVP, Mobendo

Tizen.NET. Transition of Tizen Developer Environment. Samsung Electronics S/W Center Sung-Jae Lee, Seungkeun Lee

Mobile Computing. Xamarin Data Binding MVVM Pattern. Data Binding. XAML binding example. Target Views. In simple apps. For complex or big apps

Mobile Computing Xamarin Data Binding MVVM Pattern

Chapter 19 Collection views

WebFront for Service Manager

Authoring Guide Gridpro AB Rev: Published: March 2014

Chapter 25 Page varieties

Xamarin.Forms. Pages Building an Interface

Authoring Guide v2.1 PATRIK SUNDQVIST

Index. Alessandro Del Sole 2017 A. Del Sole, Beginning Visual Studio for Mac,

RadPDFViewer For Silverlight and WPF

Xamarin.Forms. #xamarin.fo rms

XAMARIN Application Development - Workshop

4/25/ Xamarin. All rights reserved.

Week 8: Data Binding Exercise (Bookstore)

ComponentOne. Xamarin Edition

Building a mobile enterprise application with Xamarin.Forms, Docker, MVVM and.net Core. Gill

Xamarin for C# Developers

Index. Windows 10 running, 199 suspended state, 199 terminate apps,

Portable Class Libraries ---

Building Responsive Apps for Windows 10 Greg Lutz. GrapeCity

The Model provides underlying data, sometimes involving file or web accesses.

Mobile Development Updates From #MSBuild 2017 &.NET Standard (& What It Means For You) Andrew Birch

Xamarin.Forms. Pages Building an Interface

TDMobile Architecture & Overview of the TD Mobile IDE. Horst de Lorenzi

tutors Xamarin programming What is Xamarin Creating UI-apps with XAML Accessing remote data Different devices and capabilities

Chapter 16 Data binding

Note: This demo app created for this lab uses the Visual Studio 2015 RTM and Windows Tools SDK ver

Programming Windows, Sixth Edition

WPF and MVVM Study Guides

ComponentOne. Xamarin Edition

Introduction to Data Templates and Value Converters in Silverlight

Chapter 23 Triggers and behaviors

ArcGIS Pro SDK for.net UI Design for Accessibility. Charles Macleod

T R A I N I N G P U B L I S H I N G C O N S U L T I N G

Road Map for Essential Studio 2010 Volume 1

Cross Platform Development Windows 8 Windows Phone 8

Chapter 14 Absolute layout

Hands-On Lab. Building Applications in Silverlight 4 Module 6: Printing the Schedule. Printing the Schedule

Android Training Overview (For Demo Classes Call Us )

Pro Windows 8.1. Development with. XAML and C# Jesse Liberty. Philip Japikse. Jon Galloway

Road Map for Essential Studio 2011 Volume 4

Beginning Android 4 Application Development

CPSC Tutorial 5 WPF Applications

Views & View Events View Groups, AdapterViews & Layouts Menus & ActionBar Dialogs

Windows Presentation Foundation

Introduction to Xamarin Cross Platform Mobile App Development

CPSC Tutorial 5

Android UI DateBasics

Yes, this is still a listbox!

Color Swatches Pro. Magento Extension User Guide. Official extension page: Color Swatches Pro. User Guide: Color Swatches Pro

Building User Interface for Android Mobile Applications II

Certified ASP.NET Programmer VS-1025

This tutorial is designed for software developers who want to learn how to develop quality applications with clean structure of code.

Week 7: NavigationView Control Exercise

Windows Presentation Foundation (WPF)

What s New Essential Studio User Interface Edition, 2011 Volume 4

INFRAGISTICS WPF 16.1 Service Release Notes December 2016

This book was purchased by

PART I: INTRODUCTION TO WINDOWS 8 APPLICATION DEVELOPMENT CHAPTER 1: A BRIEF HISTORY OF WINDOWS APPLICATION DEVELOPMENT 3

For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to

Workspace Desktop Edition Developer's Guide. Best Practices for Views

Weather forecast ( part 2 )

Mike Taulty Developer/Evangelist Microsoft Ltd

sharpcorner.com/uploadfile/37db1d/4958/default.aspx?articleid=cb0b291c-52ae-4b80-a95c- 438d76fa1145

ROUTED EVENTS. Chapter 5 of Pro WPF : By Matthew MacDonald Assist Lect. Wadhah R. Baiee. College of IT Univ. of Babylon

RadGanttView For Silverlight and WPF

Dot Net Framework 4.0: Advanced Microsoft C#.NET Web Development

HOW TO BUILD A CUSTOM CONTROL IN XAMARIN.FORMS

IAP C# Lecture 5 XAML and the Windows Presentation Foundation. Geza Kovacs

DOT.NET MODULE 6: SILVERLIGHT

Lecture # 6 Engr. Ali Javed 11th March, 2014

Managing. mashup of chapters from. rpafi/jl enterprise88. Packt's bestselling Silverlight. Data and Media in Microsoft Silverlight 4: A.

MS_40541 Build Native Cross-Platform Mobile Apps with a Shared C# Business Logic for ios, Android, and UWP in C#.NET with Xamarin and Visual Studio

CS 528 Mobile and Ubiquitous Computing Lecture 2a: Introduction to Android Programming. Emmanuel Agu

Launchers and Choosers Hands-on Lab. Hands-On Lab. Launchers and Choosers. Lab version: Last updated: 12/8/2010. Page 1

Link-OS SDK for Xamarin README

Name of Experiment: Student Database

Overview. What are layouts Creating and using layouts Common layouts and examples Layout parameters Types of views Event listeners

Windows Presentation Foundation. Jim Fawcett CSE687 Object Oriented Design Spring 2018

Building Next Generation GUIs using Microsoft Expression Interactive Designer

Chapter 12 Styles. The basic Style

Oriol Fuertes CTO, M2MGO Bernd Mayer Technical Evangelist, Microsoft DX Germany

Hands-On Lab. Using Pivot and Panorama Controls

Beginning Silverlight 5 in C #

Note: many examples in this section taken or adapted from Pro WPF 4.5 C#, Matthew MacDonald, apress, 2012, pp

Chapter 10. XAML Markup Extensions

Chapter 21 Transforms

ArcGIS Pro SDK for.net: Advanced User Interfaces in Add-ins. Wolfgang Kaiser

Advanced Programming C# Lecture 3. dr inż. Małgorzata Janik

ArcGIS Runtime SDK for.net: Building Xamarin Apps. Rich Zwaap Thad Tilton

Exam sell. Higher Quality Better Service! Certified IT practice exam authority.

Question: Good Morning from Venezuela! Hello Matt and Andrea, it feels good to be early for a change. Answer: Great to see you again!

Mobile Application Development

Transcription:

www.dotnetcollege.cz Xamarin písanie Android a ios aplikácií v C# Roman Jašek Software Architect, Riganti s.r.o. MSP, MCP roman.jasek@riganti.cz

Xamarin vs. Xamarin Forms ios C# UI Android C# UI Windows C# UI Shared UI Code Shared C# Backend Shared C# Backend Xamarin Xamarin Forms Viac zdieľaného kódu

Natívne UI zo zdieľaného kódu <?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> </TabbedPage>

Aktuálny stav Shared UI Code Shared C# Backend 40+ stránok, layoutov, komponent (XAML) Data binding Navigácia Animácie...

Stránky Content MasterDetail Navigation Tabbed Carousel Layouty Stack Absolute Relative Grid ContentView ScrollView Frame

Komponenty ActivityIndicator BoxView Button DatePicker Editor Entry Image Label ListView Map OpenGLView Picker ProgressBar SearchBar Slider Stepper TableView TimePicker WebView EntryCell ImageCell SwitchCell TextCell ViewCell

Komponenty tretích strán

Rozdiely názvy WPF StackPanel TextBox ListBox CheckBox ProgressBar Grid Label Button Image Date/TimePicker Xamarin Forms StackLayout Entry ListView Switch ActivityIndicator Grid Label Button Image Date/TimePicker

Rozdiely Data Binding Windows DataContext {Binding Property} ItemsSource ItemTemplate DataTemplate Xamarin.Forms BindingContext {Binding Property} ItemsSource ItemTemplate DataTemplate Chýba mód OneTime

Grid, StackLayout Prakticky rovnaké použitie ako vo WPF Môžeme používať Grid v Android/iOS? Awesome!

TableView & ListView Použitie vo formulároch, menu, štruktúrovaných dátach Veľmi jednoduché na použitie Predpripravené typy buniek

TextCell

EntryCell

SwitchCell

ImageCell

ViewCell

Ladenie layoutu 1 XAML Previewer

Ladenie layoutu 2 Gorilla Player Server na PC Klient v simulátore Možnosť zobraziť priamo na telefóne Použiteľné na základné ladenie layoutu Nepodporuje custom komponenty Podporuje sample dáta

Ladenie aplikácie Xamarin Live Player Funkčná aplikácia na device ios podpora len pre Shared project Určené pre jednoduchý setup, nie zložité scenáre Zatiaľ early preview

Intellisense Extensions: Enable XAML Language for Xamarin.Forms Resharper

Data Binding Intellisense xmlns:d=http://schemas.microsoft.com/expression/blend/2008 xmlns:mc=http://schemas.openxmlformats.org/markupcompatibility/2006 mc:ignorable="d" d:datacontext="{d:designinstance test:testviewmodel}" 1. Nainstalovat XCC do projektu (Xaml Conditional Compilation) 2. Do.csproj přidat: <XccRemoveIgnorableContent>True</XccRemoveIgnorableContent> Xamarin Previewer nepodporuje Ale Gorilla Player podporuje

XAML Compilation XAML XAMLC Parsed & turned into IL Parsed and inflated

Výhody Rýchlejšie načítanie Menšia veľkosť aplikácií Chyby v XAML pri kompilácii

IoC Autofac Ninject SimpleInjector TinyIoC MvvmCross Unity XLabs má wrapper nad kontajnermi

Platforme špecifické (1)

Platforme špecifické (2) Navigácia na Activity/Storyboard Dá sa navigovať oboma smermi

Custom Renderer Keď sa niečo nedá v XAML Platformne špecifické Vo Forms projekte vyrobiť triedu V Android/iOS projekte vyrobiť Renderer [assembly: ExportRenderer(typeof(Border), typeof(borderrenderer))]

Pozitíva XAML!.Net Dokumentácia Zdieľanie kódu 85-90%

Xamarin + Swagger - Demo

Nedostatky (a ako ich riešiť)

ListView problém 1 2 ListView na stránke Riešenie: RepeaterView (XLabs)

ListView problém 2 Horizontal ListView Riešenie: RepeaterView (XLabs)

Layoutové podivnosti 1 Default spacing <Grid ColumnSpacing="0" RowSpacing="0"/>

Layoutové podivnosti 2 Grid automatické Rows/Columns <Grid> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <Label Grid.Row="0" Text="Test 1" /> <Label Grid.Row="1" Text="Test 2" /> <Label Grid.Row="2" Text="Test 3" /> </Grid>

Button Content Tlačítko má len text Riešenia: 1. Priehľadné tlačítko nad Grid 2. GestureRecognizers! (Tap, Pinch, Pan)

Circle Image BorderRadius? Custom Renderer!

Border Frame ak nepotrebujete modifikovať Inak - Custom Renderer

Menu napravo

Custom slider Gradient Vrstvy

SVG Externé knižnice Najjednoduchšie custom font

ios 10.2 fotky Info.plist: <key>nscamerausagedescription</key> <string>je v podstate jedno čo sem napíšete</string> Ďalšie oprávnenia: <key>nslocationalwaysusagedescription</key> <key>nslocationwheninuseusagedescription</key> <key>nscalendarsusagedescription</key> <key>nsremindersusagedescription</key> <key>nsphotolibraryusagedescription</key> <key>nscontactsusagedescription</key>...

BindableProperty názov public static string ErrorTextProperty public string ErrorLabelText{get set } Toto nefunguje Treba pomenovať BindableProperty rovnako ako property

Prepnutie na vyššie rozlíšenie (iphone 6S Plus...) Použiť LaunchScreen.layout namiesto obrázka v properties projektu

Real World Projekt - demo

Real World Projekt - štatistiky 80 Views 169 Controls PCL project - 549 C# súborov (88%) ios projekt - 76 C# súborov (12%)