web developer • HTML • CSS • JavaScript • Sass • Node Package Manager
#FrontendCon 2019 - @rowdyrabouw
8/157
Slide 9
web developer on native iOS / Android
Slide 10
Slide 11
web developer & native • App stores • Provisioning files • Java or Kotlin for Android • Objective-C or Swift for iOS
#FrontendCon 2019 - @rowdyrabouw
11/157
Rowdy Rabouw » @rowdyrabouw » Gouda, The Netherlands » Freelance web and app developer » Lead developer Nationale-Nederlanden Pension App » Progress Developer Expert for Nativescript » I ❤ superhero movies #FrontendCon 2019 - @rowdyrabouw
18/157
Slide 19
Slide 20
Slide 21
Slide 22
Mobile App framework
decision guide
Slide 23
Mobile App framework decision guide Do you want/need a native User Interface and native performance? No
#FrontendCon 2019 - @rowdyrabouw
Yes
23/157
Slide 24
Mobile App framework decision guide Do you want/need a native User Interface and native performance? No
Yes
Phonegap / Cordova with Ionic • WebView • DOM to manipulate • HTML styled like native
#FrontendCon 2019 - @rowdyrabouw
24/157
Slide 25
Mobile App framework decision guide Do you want/need a native User Interface and native performance? No Phonegap / Cordova with Ionic
Yes continue
• WebView • DOM to manipulate • HTML styled like native
#FrontendCon 2019 - @rowdyrabouw
25/157
Slide 26
Mobile App framework decision guide Do you have too much money and time? Yes
#FrontendCon 2019 - @rowdyrabouw
No
26/157
Slide 27
Mobile App framework decision guide Do you have too much money and time? Yes
No
Native iOS and Android • Twice the work
#FrontendCon 2019 - @rowdyrabouw
27/157
Slide 28
Mobile App framework decision guide Do you have too much money and time? Yes Native iOS and Android
No continue
• Twice the work
#FrontendCon 2019 - @rowdyrabouw
28/157
Slide 29
Mobile App framework decision guide Do you potentially want/need to share code with the web? Or do you want/need to use web technologies? No
#FrontendCon 2019 - @rowdyrabouw
Yes
29/157
Slide 30
Mobile App framework decision guide Do you potentially want/need to share code with the web? Or do you want/need to use web technologies? No
Yes
Xamarin • .NET or C# • Cross compiling • Bindings to access native APIs #FrontendCon 2019 - @rowdyrabouw
30/157
Slide 31
Mobile App framework decision guide Do you potentially want/need to share code with the web? Or do you want/need to use web technologies? No
Yes
Flutter • Dart • Cross compiling
#FrontendCon 2019 - @rowdyrabouw
31/157
Slide 32
Mobile App framework decision guide Do you potentially want/need to share code with the web? Or do you want/need to use web technologies? No Flutter
Yes continue
• Dart • Cross compiling
#FrontendCon 2019 - @rowdyrabouw
32/157
Slide 33
Mobile App framework decision guide Do you want to use modern JavaScript? No
#FrontendCon 2019 - @rowdyrabouw
Yes
33/157
Slide 34
Mobile App framework decision guide Do you want to use modern JavaScript? No
Yes
Titanium • No ES6/ES2015 support • Can’t use NPM • Old MVC framework (Alloy)
#FrontendCon 2019 - @rowdyrabouw
34/157
Slide 35
Mobile App framework decision guide Do you want to use modern JavaScript? No Titanium
Yes continue
• No ES6/ES2015 support • Can’t use NPM • Old MVC framework (Alloy)
#FrontendCon 2019 - @rowdyrabouw
35/157
Slide 36
Mobile App framework decision guide Do you know and like React? Yes
#FrontendCon 2019 - @rowdyrabouw
No
36/157
Slide 37
Mobile App framework decision guide Do you know and like React? Yes
No
React Native • React • Bridge to access native APIs
#FrontendCon 2019 - @rowdyrabouw
37/157
Slide 38
Mobile App framework decision guide Do you know and like React? Yes
No
React Native • React • Bridge to access native APIs • Hold my beer!
#FrontendCon 2019 - @rowdyrabouw
38/157
Slide 39
Mobile App framework decision guide Do you know and like React? Yes React Native
No continue
• React • Bridge to access native APIs • Hold my beer!
#FrontendCon 2019 - @rowdyrabouw
39/157
Slide 40
Slide 41
NATIVESCRIPT
Slide 42
NATIVESCRIPT
Slide 43
What is NativeScript? • Open source framework for building truly native mobile apps • JavaScript, markup (XML/HTML) and CSS • Native code inside your JavaScript if you want and dare • Cross Platform: one codebase for iOS and Android • Backed by software company Progress • Android 4.2 or a later stable official release • iOS 9.0 or later stable official release #FrontendCon 2019 - @rowdyrabouw
43/157
slider.component.ts onSliderValueChange(args) { let slider = <Slider>args.object; // opacity and volume range is 0 - 1 let sliderValue = slider.value / 100; this.viewStack.opacity = sliderValue; if (Math.round(slider.value) > 0) { this.player.play(); this.player.volume = sliderValue; } else { this.player.seekTo(0); this.player.pause(); } } } #FrontendCon 2019 - @rowdyrabouw
103/157
Slide 104
Slide 105
Packages & Libraries
Slide 106
Node Package Manager • commonly known as npm • ready to use JavaScript modules • about 650.000 packages of free, reusable code
#FrontendCon 2019 - @rowdyrabouw
106/157
Slide 107
Android Arsenal • libraries for Android (Java / Kotlin)
Cocoapods • libraries for iOS (Objective-C / Swift)
#FrontendCon 2019 - @rowdyrabouw
107/157
Slide 108
Slide 109
ngx-translate
Slide 110
Multilingual: ngx-translate • internationalization library for Angular 2+ • define translations in different languages • switch between them easily • no hardcoded text/labels, all in one place • start directly, even with one language
#FrontendCon 2019 - @rowdyrabouw
110/157
Multilingual: ngx-translate <Button [text]=“‘CHART.BUTTONS.SALARY’ | translate” ></Button> <Button [text]=“‘CHART.BUTTONS.PENSIONS’ | translate”></Button> <Button [text]=“‘CHART.BUTTONS.CHOICES’ | translate”></Button>
[] = one way data binding in Angular | = display-value transformations
#FrontendCon 2019 - @rowdyrabouw
114/157
Slide 115
Slide 116
NativeScript
Plugins
Slide 117
What are {N} plugins? When the NativeScript core modules do not provide the native device or platform capability that you need, you can use plugins. • usually for both iOS and Android • JavaScript interface to native platform code
#FrontendCon 2019 - @rowdyrabouw
117/157
nativescript-bluetooth import * as bluetooth from “nativescript-bluetooth”; bluetooth.startScanning({ seconds: 4, onDiscovered: peripheral => { if (peripheral.UUID == “CA9F644C-1920-4572-8833-1D137A6T2A05”) { bluetooth.connect({ UUID: peripheral.UUID, onConnected: peripheral => { bluetooth.stopScanning(); // do stuff } }); } } }); #FrontendCon 2019 - @rowdyrabouw
150/157
Slide 151
nativescript-accelerometer import { startAccelerometerUpdates } from “nativescript-accelerometer”; startAccelerometerUpdates(data => { // lean left (0 to -1) / right (0 to 1) let leftOrRight = data.x; // lean forward (0 to -1) / back (0 to 1) let forwardOrBack = data.y; // do stuff });
#FrontendCon 2019 - @rowdyrabouw
151/157