JavaScript Libraries In A TypeScript Application, Revisited

If you haven’t already gotten involved with it, you’ll probably know that TypeScript is becoming increasingly popular.  Being able to use a superset of JavaScript in a typed language that compiles down to JavaScript is a great thing.  However, if you’ve ever played around with TypeScript and tried to use JavaScript libraries, you’ll probably know that sometimes it can be a real pain.  Often JavaScript libraries do not ship with type definitions which are critical when it comes to playing nice with TypeScript.

If you’ve been keeping up with The Polyglot Developer you’ll probably remember two posts that were created.  Previously I had written about including external JavaScript libraries in an Angular application as well as adding type definitions to external JavaScript libraries in TypeScript.

We’re going to revisit these two articles and explore all the ways to include JavaScript libraries in TypeScript applications.  These include applications built with NativeScript, Ionic, and Angular.

(more…)

Upgrading Your Hybrid Apps To Native With NativeScript

As someone who has developed both hybrid web applications and native applications, I understand the differences and advantages each brings to the table.  While I agree that you can do some pretty neat things with a hybrid web application built with frameworks like Ionic, I no longer think it is as great of a solution as it once was.

With hybrid web frameworks like Ionic 2 and native mobile frameworks like NativeScript both using Angular 2, you have to step back and ask yourself what you’re truly getting as an advantage as of now in hybrid.  Performance is one of many reasons why native still makes more sense, and being able to use Angular 2, why wouldn’t you?

This is why I spent a lot of time creating an upgrade guide to demonstrate how to take your hybrid mobile application built with Ionic 2 and Angular 2 to native with NativeScript and Angular 2.

(more…)

Use Mozilla’s LocalForage For Key-Value Storage In Ionic Framework

A few years ago I wrote an article called Use ngStorage for all Your AngularJS Local Storage Needs, which was intended to be for AngularJS in general.  However, I understand many readers were using it in their hybrid Apache Cordova or Ionic Framework applications.  There is nothing wrong with this.  However, ngStorage is a wrapper for HTML5 local storage which is known to have compatibility issues under certain circumstances.  That said, came across localForage, a library by Mozilla, which claims to be a wrapper for local storage, WebSQL, and IndexedDB, offering maximum compatibility.

We’re going to take a look at including localForage in an Ionic Framework Android and iOS application for storing data.

(more…)

Build A Time-Based One-Time Password Manager With Ionic 2

A few years back I created an Android and iOS application called OTP Safe that managed time-based one-time passwords.  This application was made with the first version of Ionic Framework and at the time was great because it accomplished more than the Google Authenticator application.  Now that Ionic 2 is approaching stable release, it seemed like a cool idea to take this one-time password application and build it with the latest and greatest including Angular.

We're going to see how to create an iOS and Android time-based one-time password manager using Ionic 2, Angular, and TypeScript.

Converting Your Ionic Framework 1 Application To Ionic 2

Ionic Framework has been around for a few years now and has completely changed the way people develop hybrid mobile applications.  With Angular out and Ionic 2 nearing stable release, the Ionic 1 and AngularJS predecessor will be a thing of the past and forgotten.  What if you've gone all in with the first version of Ionic Framework, how do you convert to the latest and greatest?

We're going to see how to take a simple Ionic Framework application and convert it to Ionic 2.  While there will be similarities, the process is manual, but better in the long run.

Use Mozilla’s LocalForage For Key-Value Storage In Ionic 2

When it comes to saving data in an Ionic 2 mobile application, there are many ways to get the job done.  You can use the classic HTML5 local storage, but run the risk of compatibility problems between all available devices.  You can use SQLite, which is part of Ionic Native, but that will only work for Android and iOS and has more of a mobile API.  You can also use SqlStorage, but that is a very proprietary solution.  This brings us to localForage from Mozilla.

Mozilla advertises localForage as a wrapper to IndexedDB, WebSQL and localStorage which will offer maximum compatibility across the grid.

We’re going to see how to include localForage in our application which is a valid option for Ionic 2.

(more…)

Using SqlStorage Instead Of SQLite In An Ionic 2 App

When it comes to Ionic 2 there are many ways that you can store your data.  For example you could use HTML5 local storage, Mozilla’s localForage library, or Ionic’s SQLite extension that is part of Ionic Native.  With these options available, I get a lot of requests for information on Ionic’s less advertised SqlStorage option.

We’re going to take a look at using SqlStorage in an Android and iOS application rather than the SQLite alternative.

(more…)

Build A Password Manager For Android And iOS Using Ionic 2

Have you ever wanted to build your own password manager?  Maybe you don't trust the password management tools that already exist, or maybe you just want the experience.  I personally use the tool 1Password, but many of my friends don't trust the applications that exist on the market.  It is a valid concern that they have.  What if the password managers that exist are using an ancient or obsolete DES specification or similar, rather than the modern AES?  What if the master passwords are not being hashed with a strong Bcrypt algorithm?

Not too long ago we created a password manager using the NativeScript framework, but what if we wanted to build one with a different technology.

We're going to see how to build a password manager that makes use of the AES specification using Ionic 2 and Angular.  This application will work for both Android and iOS and look great on both.

Using Local Notifications In Your Ionic 2 Mobile App

A little more than a year ago I wrote a tutorial regarding using local notifications in an Ionic Framework Android and iOS application, but Ionic Framework and AngularJS is rapidly becoming a thing of the past.  Lately, anything Angular 2 is all the rage and that includes frameworks that use it like Ionic 2.  This inspired me to update my previous tutorial for the latest and greatest.

Let’s take a step back though.  Why would one want to use local notifications in their mobile application?  Well, one example might be in iBeacon detection.  An iBeacon comes into range and a notification might show.  That is just one of many examples.  Let’s also not confuse local notifications with push notifications.  Local notifications have no interaction with a service like Firebase Cloud Messaging (FCM) or Apple Push Notification Service (APNS).

We’re going to see how to schedule notifications and perform tasks based on various actions around the notifications.

(more…)

Give Your NativeScript Mobile App An Ionic Framework Theme

I’ve been developing and writing about NativeScript for a while now.  One of the things that everyone seems to bring up is that the UI NativeScript offers is unattractive in comparison to frameworks like Ionic.  Sure, it may be unattractive, but it is a native UI and had you been developing with Java or Objective-C things would be no different.  The UI is what you make of it.

I understand not everyone is a top notch UI designer so I thought I’d share a custom theme that will give you an attractive theme in your application.  If you’re familiar with Ionic Framework, it will probably look very similar since the designer, Rob Lauer, made this theme to match.

We’re going to see how to give our native application created with NativeScript a familiar Ionic Framework theme.

(more…)