SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript...

37
SPAJAMO TEHNOLOGIJU I ZNANJE KONFERENCIJA 2017.

Transcript of SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript...

Page 1: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

SPAJAMO

TEHNOLOGIJU

I ZNANJE

KONFERENCIJA 2017.

Page 2: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

▸ Sponzori

▸ Pokrovitelji

SPONZORI I POKROVITELJI

Page 3: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Razvoj multiplatformskihmobilnih aplikacija sa XamarinForms

Andrej Radinger, MVP, Mobendo

Page 4: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await
Page 5: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Native User Interfaces Native API Access Native Performance

Page 6: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await
Page 7: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Silo Approach

iOS WindowsAndroid

Objective-C

Xcode

C#

Visual Studio

Java

Android Studio

No shared code • Many languages & development environments • Multiple teams

Page 8: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Write Once, Run Anywhere

App Generator

Lua

Javascript

Actionscript

HTML+CSS

Limited native API access • Slow performance • Poor user experience

Page 9: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Xamarin’s Unique Approach

Shared C# codebase • 100% native API access • High performance

iOS C# UI Windows C# UIAndroid C# UI

Shared C# Mobile

Page 10: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Xamarin + Xamarin.Forms

Traditional Xamarin

Approach

With Xamarin.Forms:

More code-sharing, all native

iOS C# UI Windows C# UIAndroid C# UI

Shared C# Backend

Shared UI Code

Shared C# Backend

Page 11: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Xamarin’s Unique Approach

Shared C# codebase • 100% native API access • High performance

iOS C# UI Windows C# UIAndroid C# UI

Shared C# Mobile C# Server

Linux/Mono

CoreCLRAzure

Shared C# Client/Server

Page 12: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

DEMO – XAMARIN ENVIRONMENT

Page 13: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await
Page 14: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

C# is Awesome

Page 15: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

See the Different – Classes & Methods

Page 16: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Async/Await

Write Beautiful & Maintainable Code

Page 17: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Simplifying Native Methods with Async/Await

C# with Xamarin

Objective-C

Page 18: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await
Page 19: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Windows APIs

Microsoft.Phone Microsoft.Networking Windows.Storage Windows.Foundation Microsoft.Devices

System.Data System.Windows System.Numerics System.CoreSystem.ServiceMode

l

System.Net System System.IO System.Linq System.Xml

Page 20: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

iOS – 100% API Coverage

MapKit UIKit iBeacon CoreGraphics CoreMotion

System.Data System.Windows System.Numerics System.CoreSystem.ServiceMode

l

System.Net System System.IO System.Linq System.Xml

Page 21: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Android – 100% API Coverage

Text-to-speech ActionBar Printing Framework Renderscript NFC

System.Data System.Windows System.Numerics System.CoreSystem.ServiceMode

l

System.Net System System.IO System.Linq System.Xml

Page 22: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Anything you can do in Objective-C, Swift, or Javacan be done in C# and Visual Studio with Xamarin.

Page 23: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Native Performance

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.

Page 24: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Sharing Code

Page 25: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Xamarin.iOSXamarin.Android

Portable Class Libraries

Page 26: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

NuGet

Page 27: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Shared Projects

Page 28: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Development Experience

Page 29: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Visual Studio Integration

Page 30: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

DEMO – MOGY – REAL LIFE

EXAMPLE

Page 31: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Let’s take a look

Page 32: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

Meet Xamarin.Forms

Page 33: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

What’s included

✓ 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

Page 34: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

<?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">

Native UI from shared code

Page 35: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

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

Page 36: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

ICT i obrazovni sustav u Hrvatskoj“ tema je okruglog stola koji će se održati u sklopu konferencije i koja jamči zanimljivu raspravu.

Page 37: SPAJAMO TEHNOLOGIJU I ZNANJE · Write Once, Run Anywhere App Generator Lua Javascript Actionscript ... Write Beautiful & Maintainable Code. Simplifying Native Methods with Async/Await

criscon.krizevci.hr

ZA ONE KOJI ŽELE ZNATI VIŠE