Slide 1

Slide 1 text

The ionic crash course

Slide 2

Slide 2 text

Your host Bruno De Simpelaere Front-end Consultant ! [email protected] " @bursquare

Slide 3

Slide 3 text

Wat zijn Hybrid apps

Slide 4

Slide 4 text

Hybride Apps 1. WebView app - HTML,CSS & Javascript in interne browser (WebView)
 
 - Wrapped in een native app - API’s van het OS zijn beschikbaar via Javascript - b.v. Cordova 2. Compiled hybrid app - Geschreven in C# of JavaScript en wordt gecompileerd naar “native” - B.V. Xamarin 3. Compiled Hybrid App with native Javascript.. - Hierbij wordt de interne JavaScript engine gebruikt - in combinatie met native view - b.v. React Native

Slide 5

Slide 5 text

WebView Apps Voordelen - Je kan je web-kennis gebruiken. - Een code base voor meerdere platformen - Sneller, en dus goedkoper (relatief) - Makkelijk(er) om op verschillende schermen te gebruiken (responsive) - Toegang tot het device en OS-features - HTML5 + Device Offline mogelijkheden - Mogelijkheid om code te delen tussen “native” en “web” applicatie

Slide 6

Slide 6 text

WebView Apps Nadelen - Performatie issues voor bepaalde types van applicaties, b.v. indien je veel native functionaliteit nodig hebt, of zware animaties. - Het nabootsen van een native UI kan tijdrovend zijn. - Niet alle “device” en “os” features zijn toegankelijk

Slide 7

Slide 7 text

Installing

Slide 8

Slide 8 text

Voor we van start gaan.. 1. NodeJS (https://nodejs.org/en/) 2. JDK 8 (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) 
 3. Android SDK tools (of studio) (https://developer.android.com/studio/index.html) 4. Ionic & Cordova (https://ionicframework.com/docs/v1/getting-started/) npm install -g cordova ionic ♬ ♫ ♬ ♫ Your Ionic app is ready to go! ♬ ♫ ♬ ♫

Slide 9

Slide 9 text

Ionic 101

Slide 10

Slide 10 text

Ionic is een framework (maar biedt ook services) Angular Directives & Services CSS/SCSS styling Cordova wrapper ionic-CLI Ionic Cloud Ionic Creator # $ $ $ https://ionicframework.com/docs/v1/

Slide 11

Slide 11 text

Ionic Angular DOM Mobile OS

Slide 12

Slide 12 text

Ok, eventjes terugspoelen

Slide 13

Slide 13 text

Laag 1: Cordova https://cordova.apache.org/docs/en/latest/

Slide 14

Slide 14 text

Laag 2: WebView webview

Slide 15

Slide 15 text

Laag 3: Angular webview Static DOM Dynamic DOM Cordova API HTML5 API AngularJS DOM content loaded event ngApp $compile dom $(root)scope)

Slide 16

Slide 16 text

Coding Example Angular Quick Example

Slide 17

Slide 17 text

Laag 4: Ionic CSS Framework Angular Modules Custom Cordova Plugins CLI https://ionicframework.com/docs/components/#header

Slide 18

Slide 18 text

Ionic applicatie

Slide 19

Slide 19 text

Coding Example Initieel setup Ionic Cordova

Slide 20

Slide 20 text

HOOKS for cordova commands PLUGINS Packages of plugins CONFIG.XML Global configuration file PLATFORM Project directories of specific platform WWW Source code of web apps

Slide 21

Slide 21 text

HOOKS for cordova commands PLUGINS Packages of plugins CONFIG.XML Global configuration file PLATFORM Project directories of specific platform WWW Source code of web apps NPM Node package manager BOWER package manager SCSS Preprocessing of CSS styles GULP Task runner

Slide 22

Slide 22 text

% –Sindre Sorhus, Stack Overflow npm is most commonly used for managing Node.js modules, but it works for the front-end too when combined with Browserify and/or $ npm dedupe. Bower is created solely for the front-end and is optimized with that in mind.

Slide 23

Slide 23 text

% –Chris, Stack Overflow Grunt and Gulp are task runners to automate everything that can be automated (i.e. compile css/ sass, optimize images, make a bundle and minify/ transpile it) grunt vs gulp (is like maven vs gradle or configuration vs code).

Slide 24

Slide 24 text

Tooling WWW ngLocalStorage; ngCordova … Camera Location Filesystem Compile Cordova Plugins Bower Packages Server (in browser) NPM Compile SCSS Lint JS Run unit tests … Optimized WWW App

Slide 25

Slide 25 text

Le WWW (eindelijk…)

Slide 26

Slide 26 text

Coding Example Applicatie structuur

Slide 27

Slide 27 text

Eventflow device ready (cordova) DOM ready boot ng-app $compile boot plugins are useable

Slide 28

Slide 28 text

Coding Example Applicatie structuur

Slide 29

Slide 29 text

Debugging

Slide 30

Slide 30 text

Remote debugging

Slide 31

Slide 31 text

Debugging with Safari 1. Open safari 2. Klik op “Safari” > “Voorkeuren” > “Geavanceerd” 3. Vink “Toon ontwikkel menu in menubalk” https://developer.apple.com/safari/tools/

Slide 32

Slide 32 text

Debugging with Chrome 1. Schakel USB debugging in op je device 2. Verbind je Android device 3. Open chrome en surf naar https://developers.google.com/web/tools/chrome-devtools/remote-debugging/ chrome:\\inspect

Slide 33

Slide 33 text

Doe-het-eens-zelf.. :)

Slide 34

Slide 34 text

Demo App Use Camera Get data + form Save data + show list Show delete button + delete Swipe to share detail

Slide 35

Slide 35 text

Angular modules NgCordova Camera Plugin Social Sharing Plugin angular-local-storage cordova-plugin-camera
 SocialSharing-PhoneGap-Plugin Cordova Plugins

Slide 36

Slide 36 text

Start scherm

Slide 37

Slide 37 text

Foto Scherm

Slide 38

Slide 38 text

Acties

Slide 39

Slide 39 text

No content