Saturday, November 10, 2018

I saw Mark Dobossy speak on version 4 of Ionic at AngularMN on Wednesday night.

It's quite different! The first three versions of Ionic, a means to get Angular to be mobile-friendly with all of the swipe/touchability/etc. whistles and bells associated with hybrid apps, used Cordova to do what you would do with Cordova, access the camera, geolocation, and other similar goodies on a smartphone as if the app were a native application. As of version 4 Ionic uses Capacitor instead to do these things and it retreats in terms of architecture to really only be to do with the user interface and not something more sweeping. Mark showed off a helpful planner application that he made for a confused John Travolta to help him manage his affairs and in doing so went through some of the basic CLI command line commands to spin it up. The boilerplate code was an awful lot like that of an Angular application with a recognizable base module, base component, and default routing implementation. He also showed off a BLE-LED (BLE stands for Bluetooth Low Energy and thus a BLE-LED is an LED display you may talk to across Bluetooth) project he worked on with his son too and got an LED display to change from saying "Hello World" in red to saying "hello angular MN" in sort of a teal color at some fashion of Arduino implementation from the TypeScript code of an Angular (Ionic) app. There was talk of interacting with some other things too such as a QR code reader (QR codes being those square images filled with little black and white smaller squares that show up on packages that you may scan to get a URL) but I don't know that is wildly different than the camera standalone. So how does Capacitor do what it does and what makes it different than Cordova? Capacitor is a native (Objective-C/Swift/Java) application that will run at either an iPhone or an Android device which does nothing but display a browser. The browser itself doesn't look like a browser in that it has no navigation menu or anything like that and you may use this native app that has a browser in it as if the whole experience were a native experience and Average Joe on the outside looking in will never know there is even a browser involved as the hack is faked so well. Ionic 4 is sort of portrayed even as something that lets you write "native" apps in Angular, but, of course, this is a bit of stretch as the TypeScript compiling to JavaScript does not compile down again to Objective-C or Swift or Java but instead there is the before-mentioned trickery. You are writing Angular for just another browser in the end. Your Angular code surfaces inside of the browser inside of the native app. This is not Titanium. There is the concept of "code push" in Ionic 4 and once you get an application successfully listed in an app store on a particular platform you may push down to the devices code updates in lieu of having to try to fight to get each new version of your app through the app store again. Mark Dobossy was using the XCode IDE and he mentioned that Leaflet OpenStreetMap tends to get updates a little faster than Google Maps.

No comments:

Post a Comment