Mobile App Development

Similar documents
Integrating Angular with ASP.NET Core RESTful Services. Dan Wahlin

IN4MATX 133: User Interface Software

Setting up an Angular 4 MEAN Stack (Tutorial)

By the end of this Angular 6 tutorial, you'll learn by building a real world example application:

One Framework. Angular

Decoupled Drupal with Angular

Angular2. Bernhard Niedermayer. Software Development playing around with Angular2 since alpha.

Angular 4 Syllabus. Module 1: Introduction. Module 2: AngularJS to Angular 4. Module 3: Introduction to Typescript

P a g e 1. Danish Technological Institute. Scripting and Web Languages Online Course k Scripting and Web Languages

Upgrading to Ionic 3 APPENDIX D. Angular 4

Ten interesting features of Google s Angular Project

Frontend UI Training. Whats App :

Advance Mobile& Web Application development using Angular and Native Script

Chapter 1 - Model Driven Forms

Before proceeding with this tutorial, you should have a basic understanding of HTML, CSS, JavaScript, TypeScript, and Document Object Model (DOM).

Advantages: simple, quick to get started, perfect for simple forms, don t need to know how form model objects work

VS005 - Cordova vs NativeScript

Mobile Application Development

Android App Development

Mobile Development June 2015, TEIATH, Greece

3 strategies to make your apps feel all the

UI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML

Framework7 and PhoneGap. By Lars Johnson

JAVASCRIPT JQUERY AJAX FILE UPLOAD STACK OVERFLOW

Xamarin for C# Developers

Cross-Platform Mobile-Entwicklung mit dem Ionic Framework

IONIC. The Missing SDK For Hybrid Apps. Mike

Angular 2: What s new? Jonas Bandi, IvoryCode GmbH

Index LICENSED PRODUCT NOT FOR RESALE

Lab 1 - Introduction to Angular

Extending VMware vcloud Director User Interface Using Portal Extensibility Ticketing Example

TypeScript. TypeScript. RxJS

Full Stack Web Developer

Angular from the Beginning

SwingML Tutorial. Introduction. Setup. Execution Environment. Last Modified: 7/10/ :22:37 PM

Peer-graded Assignment: Introduction to NativeScript

About me. Google Developer Expert Telerik Developer Expert Digital

ANDROID SYLLABUS. Advanced Android

MOBILE DEVELOPMENT OPTIONS PRATIK PATEL CTO TripLingo

Multi-platform Mobile App. Development with Apache Cordova

Hands on Angular Framework

Introduction to. Angular. Prof. Dr.-Ing. Thomas Wiedemann.

ANGULAR2 OVERVIEW. The Big Picture. Getting Started. Modules and Components. Declarative Template Syntax. Forms

Android Application Development Course 28 Contact Hours

Android Application Development using Kotlin

ANGULAR 2.X,4.X + TYPESRCIPT by Sindhu

Front End. Presentation Layer. UI (User Interface) User <==> Data access layer

Full Stack Web Developer

AngulAr 4 Pocket Primer

The course also includes an overview of some of the most popular frameworks that you will most likely encounter in your real work environments.

Comprehensive AngularJS Programming (5 Days)

Basics of Web Technologies

Chapter 1 - Development Setup of Angular

Mobile Applications 2013/2014

Index. Bootstrap framework ASP.NET MVC project set-up, default template, 223

INTRODUCTION TO IONIC 2

AngularJS Fundamentals

Full Stack boot camp

Living through Flash to ipad/html5 Conversion and Development

Index. Elad Elrom 2016 E. Elrom, Pro MEAN Stack Development, DOI /

Sample CS 142 Midterm Examination

Angular. конфигурируем до неузнаваемости

Chris Key. Senior Consultant. Open Circle Solutions

Steps to Set Up the Environment of Xamarin in Visual

Open Source Library Developer & IT Pro

Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jquery. Andy Gup, Lloyd Heberlie

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.

CodeValue. C ollege. Prerequisites: Basic knowledge of web development and especially JavaScript.

Angular 2 Programming

3 Days Training Program

Demystifying Angular 2. SPAs for the Web of Tomorrow

Getting started with Tabris.js Tutorial Ebook

Page Layout Using Tables

Ionic CLI is the default and easiest way to work with ionic projects. In this tutorial we will learn the ins and outs of Ionic CLI.

Professional Course in Web Designing & Development 5-6 Months

AngularJS Intro Homework

CSS. HTML5,CSS3,JS & PHP Simplified. Smart Course for Absolute Beginners. REGISTER AT:

COURSE 20480B: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

13/03/2017. Author Bartosz Zurawski (C ) Project Coordinator Joseph K. Research

When learning coding, be brave

D3 + Angular JS = Visual Awesomesauce

Static Webpage Development

Nick Senger & Jesse van den Kieboom

Nodes Tech Slides - Progressive Web Apps, 2018

Angular 5 vs. React When to Choose Which?

Programming in HTML5 with JavaScript and CSS3

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

Solving Mobile App Development Challenges. Andrew Leggett & Abram Darnutzer CM First

I, J, K. Eclipse, 156

Advanced Development with the ArcGIS API for JavaScript. Jeremy Bartley, Kelly Hutchins, Derek Swingley

XAMARIN CROSS PLATFORM DEVELOPMENT COOKBOOK BY GEORGE TASKOS DOWNLOAD EBOOK : XAMARIN CROSS PLATFORM DEVELOPMENT COOKBOOK BY GEORGE TASKOS PDF

Mobile Technologies. Types of Apps

Course Syllabus. Course Title. Who should attend? Course Description. Android ( Level 1 )

Sample Copy. Not For Distribution.

Ionic Tutorial. For Cross Platform Mobile Software Development

Advanced Angular & Angular 6 Preview. Bibhas Bhattacharya

Android Programming (5 Days)

Learn to Build Awesome Apps with Angular 2

ANDROID APPS (NOW WITH JELLY BEANS!) Jordan Jozwiak November 11, 2012

Android Online Training

Transcription:

Mobile App Development NativeScript e Angular 2+

filippo Filippo Matteo Riggio CTO @ Sviluppatore Full-Stack e Mobile

Scenario

Scenario Nativo WebView-ed Soluzioni cross - from web to native Swift - Objective C Java - Kotlin Ionic Framework Famous7 Mobile Angular UI Onsen UI Kendo UI Sencha Touch jquery Mobile Intel XDK React Native NativeScript Flutter (new!) Xamarin AppCelerator trigger.io

Come scegliere?

Time Budget Skills

Nativo + +

Soluzioni WebView-ed / Cross

Build amazing ios and Android apps with technology you already know Open source framework for building truly native mobile apps with Angular, TypeScript or JavaScript. Now also Vue.js is supported! NativeScript

NativeScript structure

NativeScript è davvero native!

NativeScript è davvero native! var time = new android.text.format.time(); // Oggetto Time in Java time.set( 1, 0, 2015 ); console.log( time.format( "%D" ) ); // 01/01/2015 var alert = new UIAlertView(); // Questo è un riferimento alla class Obj-C UIAlertView alert.message = "Hello world!"; alert.addbuttonwithtitle( "OK" ); alert.show()

Gotta catch em all!

Installazione npm install -g nativescript tns --version

Creare un nuovo progetto tns create pokeproject --ng --appid it.kaleidoscope.pokeproject tns platform add ios tns platform add android

Data, data, data! /** ---- app.module.ts ---- **/ // Import the library import { NativeScriptHttpModule } from "nativescript-angular/http"; // Inject the module @NgModule({ [...] imports: [NativeScriptModule, NativeScriptHttpModule] })

App logic /** ---- app.component.ts ---- **/ // Imports import { Component, OnInit } from "@angular/core"; @Component({ selector: "my-app", templateurl: "app.component.html" }) export class AppComponent implements OnInit { public constructor() {... } public ngoninit() {... } public showinformation(index: number) {... } public showdialog(data: Array<string>) {... } }

Gotta catch em all! /** ---- app.component.ts ---- **/ // Imports import { Http } from "@angular/http"; import "rxjs/rx"; export class AppComponent implements OnInit { public pokemon: Array<any>; public constructor(private http: Http) {... } public ngoninit() { this.http.get("https://pokeapi.co/api/v2/pokemon?limit=151").map(result => result.json()).flatmap(result => result.results).subscribe(result => { this.database.getdatabase().createdocument(result); this.pokemon.push(result); }, error => { console.error(error); }); } }

User interface /** ---- app.component.html ---- **/ <ActionBar title="pokeproject"></actionbar> <StackLayout> </StackLayout> Docs: https://docs.nativescript.org/ui/basics

User interface - grid layout /** ---- app.component.html ---- **/ <GridLayout rows="auto" columns="auto, *, auto"> </GridLayout> Docs: https://docs.nativescript.org/cookbook/ui/layouts/grid-layout

User interface - list view /** ---- app.component.html ---- **/ <ListView [items]="pokemon"> <ng-template let-monster="item" let-index="index"> <GridLayout/> </ng-template> </ListView> [...] <GridLayout rows="auto" columns="auto, *, auto" margin="15"> <Label row="0" col="0" class="pokemon-number" text="{{ index + 1 }}. marginright="10"></label> <Label row="0" col="1" class="pokemon-name" [text]="monster.name"></label> <Image row="0" col="2" class="pokemon-image" src="~/images/{{index + 1}}.png"></Image> </GridLayout>

A bit of style! /** ---- app.css ---- **/.pokemon-number { font-weight: bold; }.pokemon-name { text-transform: capitalize; }.pokemon-image { animation-name: pokemon-image; animation-duration: 1s; animation-delay: 1s; opacity: 0; } @keyframes pokemon-image { from { opacity: 0; transform: rotate(0deg); } to { opacity: 1; transform: rotate(360deg); } }

Aggiungere un event listener /** ---- app.component.html ---- **/ <GridLayout [...] (tap)="showinformation(index+1)"> [...] </GridLayout> /** ---- app.component.ts ---- **/ public showinformation(index: number) { this.http.get("https://pokeapi.co/api/v2/pokemon/" + index).map(result => result.json()).flatmap(result => result.types).map(result => (<any> result).type.name).toarray().subscribe(result => { this.showdialog(result); }, error => { console.error(error); }); }

Native Dialogs /** ---- app.component.ts ---- **/ // Import the library // https://docs.nativescript.org/cookbook/ui/dialogs import dialogs = require("ui/dialogs"); public showdialog(data: Array<string>) { dialogs.alert({ title: "Information", message: "Questo pokemon è del tipo " + data.join(", "), okbuttontext: "OK" }); }

Native Plugins tns plugin add nativescript-couchbase /// <reference path="./node_modules/nativescript-couchbase/couchbase.d.ts" />

Camera quick example import * as camera from "nativescript-camera"; import { Image } from "ui/image"; var options = { width: 300, height: 300, keepaspectratio: false, savetogallery: true }; camera.takepicture(options).then((imageasset) => { let image = new Image(); image.src = imageasset; console.log("size: " + imageasset.options.width + "x" + imageasset.options.height); console.log("keepaspectratio: " + imageasset.options.keepaspectratio); console.log("photo saved in Photos/Gallery for Android or in Camera Roll for ios"); }).catch((err) => { console.log("error -> " + err.message); });

Couchbase DB provider /** ---- database.ts ---- **/ import { Couchbase } from 'nativescript-couchbase'; export class Database { private db: any; public constructor() { this.db = new Couchbase("db"); } public getdatabase() { return this.db; } } /** ---- app.component.ts ---- **/ @Component({ selector: "my-app", templateurl: "app.component.html", providers: [Database] }) export class AppComponent implements OnInit { public constructor(private http: Http, private database: Database) { [...] } }

NoSQL MapReduce View /** ---- database.ts ---- **/ [...] public constructor() { this.db = new Couchbase("db"); this.db.createview("pokemon", "1", (document, emitter) => { emitter.emit(document._id, document); }); } [...]

Caching dei dati /** ---- app.component.ts ---- **/ public ngoninit() { let rows = this.database.getdatabase().executequery("pokemon"); if (rows.length == 0) { this.http.get("https://pokeapi.co/api/v2/pokemon?limit=151").map(result => result.json()).flatmap(result => result.results).subscribe(result => { this.database.getdatabase().createdocument(result); this.pokemon.push(result); }, error => { console.error(error); }); } else { for (let i = 0; i < rows.length; i++) { this.pokemon.push(rows[i]); } } }

Accesso alle Api Native della UI // NativeScript XML tag <ActionBar title="sign up"></actionbar> // Controller Obj-c (mappato in node_modules/tns-core-modules/ui/frame/frame.ios.js) UINavigationController // Componente UI Obj-c // (mappato in node_modules/tns-core-modules/ui/action-bar/action-bar.ios.js) UINavigationBar // Modificare lo stile della ActionBar per ios if (page.ios) { var navigationbar = framemodule.topmost().ios.controller.navigationbar; navigationbar.barstyle = UIBarStyle.UIBarStyleBlack; }

Comandi utili tns prepare [ios android] tns build [ios android] tns deploy [ios android] tns emulator [ios android] tns run [ios android]

References Documentazione di NativeScript http://docs.nativescript.org Lista dei plugins (certificati da Telerik) http://plugins.nativescript.org How NativeScript Works http://developer.telerik.com/featured/nativescript-works/ Performances (web-view) https://github.com/mlynch/pgday-eu-2017-perf/blob/master/web-perf-2017.pdf

Questions

Thank you Filippo Matteo Riggio CTO @kaleidoscope @FMRiggio