Modify The Badge Number Of An Ionic Framework App

July 11, 2015 Nic Raboy

Previously I did a post on Simon Reimler’s blog regarding local notifications with Ionic Framework. However, there is a different kind of notification you can use in your application. In iOS and many different flavors of Android (not all), you have the opportunity to use badge indicators on your launcher icon. Although this doesn’t notify users with a prompt, it will still notify them on their home screen that something needs their attention.

There is a nifty Apache Cordova plugin created by Sebastián Katzer called cordova-plugin-badge that will allow us to easily add this functionality to our Ionic Framework mobile applications.

Read More

Monitor Device Battery Status Using Ionic Framework

July 5, 2015 Nic Raboy

So you’re making a mobile app using Ionic Framework and you care about the experience your users receive? Maybe you want to control the functionality of certain features based on how much battery the users device has left.

An example of this is, maybe you have your application pulling remote data while the application is open. Maybe you’ve decided that if your users battery is less than 30% you want the user to have to pull-to-refresh in order to preserve battery life.

This kind of battery monitoring can be performed through the cordova-plugin-battery-status plugin by Apache Cordova.

Read More

My First Year Of Blogging And The Stats Around It

July 3, 2015 Nic Raboy

One year ago from today, I started this code blog. I set off to help people with niche topics that I myself banged my head when trying to solve.

Through the months, I’ve gotten more traffic, followers, comments, and even job offers. Here are the stats to reflect my journey as a blogger.

Read More

Override The AngularJS Exception Handler

June 28, 2015 Nic Raboy

AngularJS is one of the hottest things around right now. Maybe you’re finding yourself getting pretty deep in its greatness and you’re ready to customize how exceptions are handled by default.

Lucky for us there is a way to override the default functionality and do whatever we want when an error happens.

Read More

Use RegEx To Analyze Credit Card Numbers In JavaScript

June 21, 2015 Nic Raboy

RegEx is a powerful beast. Previously I wrote how to test password strength using JavaScript and regular expressions. This time we’ll take a look at how to check credit card providers based on the credit card number entered. No, this won’t test if a credit card number is legitimate, but it will test if it was entered correctly.

Read More

Extending The Gradle Build File In Apache Cordova 5.0+

June 10, 2015 Nic Raboy

Apache Cordova 5.0 brought many changes, all of which are for the best, but many of which are a major inconvenience in terms of development or deployment. For example, previously I wrote about whitelisting external resources in Ionic Framework because by default everything is now blacklisted.

This time we’re going to explore the new default build system, Gradle. This build system is nothing new as I’ve written about it in the past, however, it is new when it comes to Apache Cordova and hybrid mobile application development.

You may run into library conflicts or need to do little customizations to your build process. We’re going to see how to do these things. Gradle is for Android only, so if you’re developing for iOS, feel free to move along.

Read More

From Bitmap To Base64 And Back With Native Android

June 2, 2015 Nic Raboy

Working with images in Android is great, but what happens when you need to store them somewhere other than the file system? Let’s say for example you want to store them in a SQLite or NoSQL type database. How would you store such a piece of data?

One common way to store image data would be to first convert the image into a base64 string. We all know strings are very easy to store in some data structure.

Base64 via Wikipedia:

A group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation.

Another way would be to store the binary data in a CLOB or BLOB type SQL column, but to keep it generic, in this particular example, we will be exploring the idea of converting images into base64 strings.

Read More