NativeScript & Angular 2

Ähnliche Dokumente
JS goes mobile: Eine Übersicht. Frederik von Berg w11k / thecodecampus

Cross-Platform Apps mit HTML5/JS/CSS/PhoneGap

Cross-Plattform-App- Entwicklung mit Visual Studio 2017

Übung 1: Von einer naiven JavaScript Applikation zu einem modernen Front-End Build:

Wir bringen Ihre Notes/Domino Anwendungen sicher ins Web , Bilster Berg Drive Resort Michael Steinhoff, agentbase AG.

Echte Cross-Plattform Anwendungen mit Angular 2 in Action!

The app the crashes, before the breakpoint is reached: Code to the event:

Cross Platform Development mit SharePoint

Jörg Neumann Acando GmbH

Mobile Development in.net mit Xamarin

Frontend-Entwicklung mit JavaScript

Cross-Platform Mobile Development mit Xamarin Mark

APEX DESKTOP APPS. Interaktion mit dem Client System

! Jahrgang ! Studium der Mathematik und Informatik an der TU Braunschweig. ! Entwicklung klassischer Client-Server-Systeme zur Terminplanung

Cross-Platform Mobile Apps

Meine App, die Cloud und ich

Öko APEX Hybride Lösung für Smartphones mit APEX und PhoneGap

2.1. Short description to bug Xamarin.Forms: ListView not scrollable in a ScrollView in a Stacklayout on Android

Apps entwickeln mit HTML und Javascript

Programmierung mobiler Geräte

informatik ag IT mit klarer Linie S i e b e l O p e n U I

JavaFX auf Mobile. von Stefan Barth und Stefan Heinze

Cross-Platform Mobile mit.net

Einführung in Google Web Toolkit

Mobile Apps mit DSLs. und entfernter Codegenerierung. Codierst Du noch oder generierst Du schon? Powered by

Mit Cloud Power werden Sie zum

Autorensysteme für mobile Anwendungen - Totgesagte leben länger. Prof. Dr. Michael Bauer Autorensysteme

ADF Mobile konkret Best Practices Live erklärt. Jan Ernst

SIEBEL OPEN UI. Rhein-Main-Handel GmbH. Bankhaus Goldbaum GmbH & Co. KG. Standort: Düsseldorf. Standort: Frankfurt ilum:e informatik ag

HTML5 und das Framework jquery Mobile

Dirk Reinemann Working Student Sales Consulting

Node.js Einführung Manuel Hart

Mobile App development mit Xamarin. Christian Hassa Andreas Willich TechTalk Software AG

Über mich. Daniel Bälz. Softwareentwickler (inovex GmbH) github.com/dbaelz

App Entwicklung mit Hilfe von Phonegap. Web Advanced II - SS 2012 Jennifer Beckmann

Cross Plattform App Developement. Simon Groth

Mit Cloud Power werden Sie zum

JavaScript Frameworks für Mobile

The linux container engine. Peter Daum

Einführung in die Cross-Plattform Entwicklung Das Intel XDK

Mobility mit IBM Worklight Erste Schritte zu einer mobilen App. Benjamin Stein, Consultant Stuttgart,

Florian Rappl. TypeScript

Good Practice: Entwicklung einer Smartphone App mit Unterstützung von Open Text WSM. OpenText Websolutions Usergroup,

Ein mobiler Electronic Program Guide

Ein UI in zwei Welten - Controls in HTML5 und WPF. Timo Korinth

Lessons Learned: Mobile CRM Integration

Die perfekte Online-Hilfe auf Basis von HTML5 und Open-Source- Komponenten. Jochen Marczinzik , tekom Führjahrstagung

Mobile Backend in der

Apollo Überblick. Klaus Kurz. Manager Business Development Adobe Systems Incorporated. All Rights Reserved.

TUT1 Javascript-Frameworks zum Erstellen von plattformunabhängigen mobilen Anwendungen

Web-Anwendungsentwicklung mit dem Delivery Server

Eine App, viele Plattformen

Smartphone Entwicklung mit Android und Java

ZenQuery - Enterprise Backend as a Service Single Page Applications mit AngularJS und Spring MVC. - Björn Wilmsmann -

Mobile Application Development

Moderne Web- Anwendungen mit

Dominik Helleberg inovex GmbH. Android-Enterprise- Integration

Webentwicklung mit Vaadin 7. Theoretische und praktische Einführung in Vaadin 7. Christian Dresen, Michael Gerdes, Sergej Schumilo

Apps-Entwicklung mit Netbeans

Webseiten werden mobil Planung geht vor

Der SCHWEIZER WELTATLAS interaktiv als Web Applikation

Zend PHP Cloud Application Platform

App Entwicklung für Android F O R T G E S C H R I T T E N E P R O G R A M M I E R U N G I N J A V A

DCCS Lotusphere Nachlese 2012 Was sind XPages? Mobile Features für XPages

Der mobile Technologie-Dschungel Eine Roadmap. Dr. Frank

Was gibt es Neues im Office 365 Umfeld?

UI Technologien für SAP-Anwendungen

Software Engineering II

Vom Prototypen zur Anwendung

Mobile API 2.0 Partizipative App Entwicklung

Relution Enterprise Appstore. Enable Enterprise Mobility. 2.5 Release Note

LaVida. Mobile Endgeräte. Andreas Neupert

WEBAPPS MEDIEN ZWISCHEN TECHNOLOGIE UND GESELLSCHAFT PROF. DR. MANFRED THALLER JONAS SCHOPHAUS UNI KÖLN WS 2012

Entwicklung und Integration mobiler Anwendungen. <Speaker> Oracle Deutschland B.V. & Co. KG

Vaadin ein Erfahrungsbericht

JDroidLib mit Eclipse (Mac/Linux/Windows)

Partnertag 2014 Visionen und Trends Die Contrexx Roadmap

Xojo für FileMaker Entwickler

BOSS 2 BSZ One Stop Search

Mobile Angebote Strategie einer Verwaltung. Freie und Hansestadt Hamburg Dr. Ursula Dankert

AK Medientechnologien Hello World. Josef Kolbitsch

Einführung in die Cross-Plattform Entwicklung Das Intel App Framework

TM1 mobile intelligence

Einführung in die Cross-Plattform Entwicklung Web Services mit dem Intel XDK

Einführung mobile Entwicklungsplattform Neptune Application Designer Fink IT-Solutions Christian Fink, Andreas Hofmann

Ein ganz normaler Tag. Eclipse und Ich

Visual Studio 2012 Windows 8 und.net 4.5. Hans Peter Bornhauser, Noser Engineering AG Fachbereichsleiter.NET, Digicomp AG

Vaadin TouchKit. W3L AG

Moderne Benutzeroberflächen für SAP Anwendungen

Daten in der Cloud mit Access, Office 365 und Apps foroffice Dirk Eberhardt

MOBILE ENTERPRISE APPLICATION PLATFORM (MEAP)

Plattformunabhängige App-Entwicklung - Eine für alle?

Graphen in Apex von Thomas Hernando.

Apps-Entwicklung mit Eclipse

Transkript:

NativeScript & Angular 2 Von der WebApp zur nativen SmartphoneApp Frederik von Berg W11K / thecodecampus

Überblick <1> <2> <3> <4> <5> <6> Über mich Ausgangslage Was ist Angular? Was ist NativeScript? Was muss man bei Apps beachten? Portierung NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 1

Über uns Frederik von Berg <> Software Developer Seit 2013 bei w11k GmbH Scala und WebEntwicklung </> W11K GmbH the Web Engineers <> Gegründet 2000 Entwicklung / Consulting Web / Java Esslingen / Siegburg </> thecodecampus.de Weiter. Entwickeln. <> Schulungen (seit 2007) ProjektKickoffs Unterstützung im Projekt </> NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 2

Trello Screenshot NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 3

Calendar for Trello Screenshot NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 4

e re Sc Native App t ho ns https://calendarfortrello.com/ 5

NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp

Ausgangslage <> Calendar for Trello Angular Webapp <> Portierung mit wenig Aufwand <> keine Hybrid App NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 6

Was ist Angular? NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp

Was ist Angular? LazyLoading AheadoftimeCompilation DependencyInjector Services CLI Komponenten Module Pipes Renderer SinglePageApplication NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 8

Komponenten <> Grundlegendes Konzept in Angular 2 <> Gesamtes UI ist aus Baum von Komponenten aufgebaut Wiederverwendbare Elemente Grungerüst der Seite <> Komponenten bestehen aus Template / View (HTML) Klasse Decorator an Klasse NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 9

Komponenten Code Typescript 1 2 3 4 5 6 7 8 9 10 import { Component } from "@angular/core"; @Component({ // css selector to find the component's usage selector: "musicapp", template: ` <h1>music App</h1> ` }) export class MusicAppComponent {} Html 1 2 3 <body> <musicapp></musicapp> </body> NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 10

Services <> Sehr allgemeines Konzept Irgendwelche Funktionalität kapseln Nicht UI spezifisch Implementierungsdetails verstecken <> Einsatzmöglichkeiten Höhere Abstraktion schaffen (REST) Integration anderer Bibliotheken (WebSocket) Datenhaltung, Datenzugriff, Caching, Logik,... <> Können Abhängigkeit zu anderen Services haben NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 11

Services Code <> Services sollten in Angular 2 als Klassen implementiert werden 1 2 3 4 5 6 7 8 9 import {Artist} from "./artist.model"; export class ArtistService { getallartists(): Artist[] { /* return demo data or data from local storage * or data loaded from server or... */ return []; } } NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 12

Module <> Angularspezifischer Code muss organisiert werden Gleiche Grundgedanken und Aufbau wie bei ES6 Modulen Kapselung & Wiederverwendbarkeit Leichtes Einbinden von Bibliotheken Genaue Steuerung was wo verwendet wird <> Ein Modul ist eine annotierte Klasse NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 13

Module Code <> AngularModule bestehen u.a. aus Imports: Welche anderen Module werden intern verwendet Declarations: Was intern bekannt ist (quasi lokale Variablen) Exports: Was wird nach außen bekannt gemacht (für andere Imports > Module) 1 2 3 4 5 6 7 @NgModule({ declarations: [ AppComponent, MusicAppComponent ], imports: [ BrowserModule, FormsModule, HttpModule ], exports: [ AppComponent ], providers: [ ArtistService ] }) export class AppModule { } NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 14

Renderer <> DOM Entkoppelung <> Renderer wird beauftragt, um DOM zu ändern <> Typen: Angular Renderer Angular Universal NativeScript NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 15

Was ist NativeScript? NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp

Was ist NativeScript? <> Open Source <> JavaScript, XML(HTML), CSS <> TypeScript > Angular2 <> Layouts <> Generiert Native Elemente <> Android 4.2, ios 8 NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 17

Was ist NativeScript? Funktionsweise <> JS Engine generiert native Elemente <> Schnittmenge von nativen Komponenten Label Button Switch, Slider, Image... <> Voller Zugriff auf native Funktionalitäten (z.b. Kamera) <> Plattformspezifische Benutzerführung <> Plattformspezifische Anpassungen möglich <> Node Plugins können genutzt werden <> Unit Testbar <> UI Testframework verfügbar NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 18

Was ist NativeScript? Funktionsweise Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 if (application.android) { let intent = new android.content.intent( android.content.intent.action_view, android.net.uri.parse(this.card.url) ); application.android.currentcontext.startactivity( android.content.intent.createchooser(intent, "Open Card...") ); } else if (application.ios) { dialogs.alert("sorry, this is not implemented yet.").then(function() { console.log("dialog closed!"); }); } NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 19

Was ist NativeScript? UIKomponenten NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 20

Was ist NativeScript? UIKomponenten NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 21

Was ist NativeScript? Layout <> AbsoluteLayout <> DockLayout <> GridLayout <> StackLayout <> WrapLayout <> FlexBoxLayout Abb: NativeScript Docs NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 22

Was ist NativeScript? Layout Code 1 2 3 4 5 6 7 8 9 10 <MainActionBar title="overdue Cards"></MainActionBar> <StackLayout class="page"> <ListView [items]="cards" *ngif="cards.length > 0" class="listgroup"> <ngtemplate letcard="item"> <calendarcard [card]="card" class="listgroupitem"> </calendarcard> </ngtemplate> </ListView> </StackLayout> NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 23

Was ist NativeScript? Layout NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 24

Was ist NativeScript? Styling <> CSS Styling (Sass & Less möglich) <> Ganze App: app.css <> Plattformspezifisch: app.android.css app.ios.css <> ein Stylesheet pro Template (Angular spezifisch) <> InlineStyling <> Theme seit 2.4 definierte CSSAttribute (h1, body, textprimary, mt5 ) Themebuilder NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 25

Was ist NativeScript? Tooling <> Benötigt: Node, npm... IDE der Wahl Android SDK + Emulator XCode für ios JS, HTML, CSS Kentnisse... learning by doing ;) <> Liefert: CLI > npm install g nativescript Visual Studio Code Plugin Hot Reloading / Livesync Debugging (Chrome oder Visual Studio Code) NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 26

Was ist NativeScript? Tooling <> Projektsetup: tns create FirstApp ng cd FirstApp/ tns run android NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 27

Vorteile einer App Was muss man bei Apps beachten? NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp

Was muss man bei Apps beachten? <> Web App / Website: Informativ Benötigt eine Datenverbindung einfache Updates Responsive <> Mobile app: Interaktiv Task driven ohne Datenverbindung möglich Benachrichtigungen Branding / Kundenbindung Performance Native Oberfläche, gewohnte Benutzerführung NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 29

Mobile App auf Web App Basis Eine Codebasis? NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp

Mobile App auf Web App Basis Allgemein <> UI und plattformunabhängiger Code teilen (Services, Models, Pipes,...) NPM Abhängikeiten müssen gleich sein window darf nicht referenziert sein platformspezifischer Code kann evtl. nicht geteilt werden (z.b. "Localstorage") <> Komponenten haben unterschiedliche Templates <> Authentifiezierung muss evtl. umgestellt werden NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 31

Mobile App auf Web App Basis Allgemein <> Möglichkeiten: Projektstart: Angular + NativeScript Seed/Starter Projekt Komplex: geteilte NPM Pakete Pragmatisch: Symlinks Geteilte Resourcen müssen immer unterhalb des /app Verzeichnis in NativeScript liegen, sonst werden diese nicht mit in die App gepackt und können nicht genutzt werden. NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 32

Mobile App auf Web App Basis Seed Projekte <> Verfügbarkeit: NathanWalker/angularseedadvanced jlooper/angularstarter <> Aufbau: alles in einem Verzeichnis geteilter Code in "shared" Verzeichnis Templates werden ausgetauscht (*.tns.html) <> Funktionsweise: Build kopiert shared files in NativeScript Build ersetzt die Importpfade entsprechend <> Für neue Projekte geeignet <> Annahme: die UI wird auseinanderlaufen <> viel "Magic" im Spiel NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 33

Mobile App auf Web App Basis NPM Paket <> geteilen Code in npm Pakete packen <> kapseln in Module <> Paket in NativeScript Projekt nutzen <> Herausforderung: Pflege Build + Auslieferung <> Geeignet: falls die WebApp schon fertig ist <> Projekte müssen nicht am gleichen Ort liegen NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 34

Mobile App auf Web App Basis Shared Folder <> Pragmatisch <> Dependencies des Clients auf NativeScript anpassen <> geteilten Code in "shared"ordner legen <> "shared"ordner per Symlink in NativeScript "app"ordner einbinden <> Funktioniert super für einen Prototyp <> erstmal keine Buildanpassung nötig NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 35

Na, noch Fragen? frederikvonberg github.com/fvonberg NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp

info@thecodecampus.de @thecodecampus www.w11k.de www.thecodecampus.de

Quellen Webseiten: https://www.angular.io/ https://www.nativescript.org/ Logos und Bilder: Font Awesome by Dave Gandy http://fontawesome.io https://developer.android.com/index.html https://developer.apple.com/ NativeScript & Angular 2: Von der WebApp zur nativen SmartphoneApp 38