Sunday, August 20, 2017

NDC Sydney 2017 App

The #ndcsydney is finally over. This year it has been a little unique for me. Not only am I speaking at the event, the conference organizer has also adopted my app that I developed for the conference (using React Native). It was a good experience to see how well the framework works for cross platform development, and to be honest it went really well. Also, given the tight deadlines and limited testing, I really need to make sure the app runs smoothly without hiccups for the entire conference. And it went well!

Saturday, August 19, 2017

Courses for August and September 2017 - IoT, Python, Raspberry Pi, Machine Learning, and Bluetooth LE

 WEB106 – 1-Day Programming Web Apps using Node.js
Node.js is an open source, cross-platform runtime environment for creating Web apps and Web services. Node.js apps are written using JavaScript, and it provides an event-driven architecture and a non-blocking I/O API that enhances an application’s throughput and scalability. Using Node.js, you can even write your own Web server! 
In this course, you will learn how to get started with Node.js and how to use it to write some cool Web applications and REST services. 

 AND303 – 1-Day Advanced Android – Bluetooth Low Energy Programming 
In recent years, we have seen a proliferation of Bluetooth Low Energy (Bluetooth LE) devices. Bluetooth LE, as its name implies, uses low energy for transmitting data. This is very useful for devices that require long-battery life, such as heart rate monitor, temperature sensors, etc. In Android, Bluetooth LE functionalities weren’t supported at the platform level until Android 4.3. 
Beginning with Android 4.3, you can now write applications that use Bluetooth LE. Your application can now connect to heart monitors, as well as temperature sensors using Bluetooth LE. 

 IOT201 – Applied Python Programming 
Python is a high-level programming language that is widely in use. Python code is readable, and its syntax ensures programmers write code that is well-indented and clear. Python is supported on most platforms and is well suited for a wide variety of tasks – ranging from automating your daily platform tasks, to running as a standalone Web Server. 
In this course, you will learn about the Python language, as well as explore the different types of projects that you can develop with it. 

 IOT203 – Machine Learning using Azure Machine Learning Studio and R 
In this 2-day workshop, you will be introduced to Machine Learning using the Microsoft Azure Machine Learning Studio. You will learn what is machine learning, and how it can be useful to your organization. You will also learn the various machine learning algorithms and work through some real-life examples. 

 IOT205 – Introduction to Machine Learning using Python 
In this 2-day workshop, you will be introduced to Machine Learning using Python. You will learn about the various libraries used in Python for machine learning, as well as the fundamental principles of some common machine learning algorithms. 

 MOB105 – 2-Day Cross Platform Mobile Apps Development using React Native 
In this 2-day workshop, you will learn the fundamentals of building cross-platform mobile apps targeting iOS and Android devices using React Native. React Native lets you build mobile apps using only JavaScript, without the need to use languages like Objective-C, Swift, or Java. Although you write JavaScript with React Native, the components you define will end up rendering as native widgets on the respective platforms. Hence, React Native allows you to write truly native applications, with the ease and speed of development and debugging using JavaScript. 

 HRD101 – 1-Day Getting Started with Raspberry Pi 

The Raspberry Pi 2 is a low-cost (US$35) credit-sized computer that connects to your TV and keyboard. Running Linux as the operating system, it can be used for many purposes such as word-processing, games, spreadsheets, web browsing, and more; almost everything that you can do with a regular computer. What’s more, using the Raspberry you can connect the general purpose input and output (GPIO) pins right on the board to drive external hardware such as LEDs, motors, and relays. 

Friday, June 02, 2017

DevTeach app developed using React Native now available on Google Play and Apple App Store

Developing cross platform mobile apps is currently one of the most important topics for developers - no one wants to maintain multiple code bases unnecessarily, and code reuse is super important. Hence, I wanted to see for my myself how React Native can help in this. 

And so I went out to develop an app for the DevTeach ( conference (in which I am speaking and running a workshop next month). And here I created quite a simple app in a couple of days. And it runs on both Android and iOS. 

Overall, I am quite pleasantly surprised by the versatility of React Native and I saved quite a lot of time in testing my UI as I don't have to redeploy the app every time I have an UI change - pressing Cmd-R reloads your app. 

You can now download the DevTeach app from Google Play as well as from Apple's App Store

Wednesday, May 17, 2017

Running Xamarin.Forms application on an iPhone without using a Mac

By now, you should probably have heard of the latest news from Microsoft about the latest preview edition of Xamarin that allows you to test your Xamarin application on your iPhone without using a Mac. Note that this is only applicable for Xamarin.Forms application, not the Xamarin.iOS application, which still requires you to connect to a remote Mac in order to edit your Storyboard files. 

Getting the Preview Bits
First, you need to download Visual Studio 2017 Preview from

Once Visual Studio 2017 Preview is installed, install the Xamarin Updates Extension (

Once this is done, let’s create a new Cross Platform App (Xamarin.Forms) and name it as HelloWorld:

Select the Blank App template and click OK.
At the toolbar of Visual Studio 2017 Preview, click on the Live Player button:

You should now see a QR Code:

On your iPhone, download and install the Xamarin Live Player ( Launch it and you should see the following:

Tap on the Pair to Visual Studio button and scan the QR code on your screen. It will now try to connect to Visual Studio:

Back in the original window that showed the QR code you will see the name of your iPhone connected:

When you ready to run the application on the iPhone, select the HelloWorld.iOS project in the toolbar of Visual Studio 2017. Click the Live Player button. At this moment, you will be asked to connect to a remote Mac. Ignore it. Instead, you should now see the name of your iPhone:

Click on the name of your iPhone and your application should now appear on your iPhone:

Tuesday, May 16, 2017

MOB105 - Learn iOS and Android programming without needing a Mac

With the Create React Native App (CRNA), you no longer need to use a Mac when you are learning how to program iOS apps. In addition, you also do not need to install Android Studio on your machine if you want to learn Android programming.

In this 2-day course, you will learn how to develop native iOS and Android apps using:

  • React Native
  • ECMAScript 2015 (ES6)

Best of all, you don't have to learn a new language (such as Objective-C, Java, or Swift) and your app is a pure native app. What's more, React Native supports live and hot reload (which saves you time during development phase) and dynamic app updates (without resubmitting your apps to AppStore or Google Play after it has been deployed).

MOB105 - Cross Platform Mobile Apps Development using React Native
Course Fee
S$1297 (nett; no GST)
If your company is sponsoring you for the training, your company can enjoy 400% tax deductions/ allowances and/or 40% cash payout for investment in innovation and productivity improvements under the Productivity and Innovation Credit (PIC) scheme. For more details, check out the Productivity and Innovation Credit page. 
Start DateEnd DateCourse Outline and Application FormCategory
Tue May 30 2017Wed May 31 2017

Learn cross-platform mobile apps development using React Native
Mon Jun 12 2017 CONFIRMEDTue Jun 13 2017

Learn cross-platform mobile apps development using React Native
Wed Sep 20 2017Thu Sep 21 2017

Learn cross-platform mobile apps development using React Native
Hotel Grand Pacific Singapore
101 Victoria Street
Singapore 188018

Developing native iOS and Android apps without installing Xcode or Android Studio!

Want to learn iOS programming but don't have a Mac? Want to learn Android programming but facing a lot of difficulties in setting up the SDK? Well, you can now learn how to write cross-platform native apps using the new Create React Native App (CRNA), without needing to install Xcode or Android Studio! This means that you also don't need a Mac to learn iOS programming!

With CRNA, all you need to do is to install node and npm on your computer. Then, install the CRNA command line tools:

$ npm i -g create-react-native-app

To create a project named HelloWorld, use the following command:

$ create-react-native-app HelloWorld
$ cd HelloWorld

Once the project is created, the project folder will contain the following files:

  • App.js  
  • App.test.js 
  • app.json 
  • node_modules 
  • package.json

You would develop the app just like a normal React Native app. When you are ready to test the app, simply use this command:

$ npm start

A barcode that is unique to your app will now be generated.

That's it! To view your app, download the Expo Client app on your iPhone or Android device. Scan the barcode unique to your project and voila, your app now runs on your iPhone or Android.

I think this is the coolest way to learn iOS and Android programming!

Monday, May 15, 2017

Using the crosstab() function in Pandas

If you are doing Data Science or Machine Learning in Python, chances are you will come cross a function named crosstbab() frequently.
So, what does it do? Let me explain that with an example.

From the documentation, the crosstab() function computes a simple cross-tabulation of two (or more) factors.

Consider the following example:

import pandas as pd
df = pd.DataFrame(
        "Gender": ['Male','Male','Female','Female','Female'], 
        "Team" : [1,2,3,3,1]

The above code snippet will print out the following:

   Gender  Team
0    Male     1
1    Male     2
2  Female     3
3  Female     3
4  Female     1

Now, it would be useful to see the distribution of genders across the teams, and this is where the crosstab() function comes in:

print("Displaying the distribution of genders in each team")
print(pd.crosstab(df.Gender, df.Team))

The above code snippet will print out the following:

Displaying the distribution of genders in each team
Team    1  2  3
Female  1  0  2
Male    1  1  0

Now you know!

Sunday, May 14, 2017

Dynamically Creating Your UI using React Native

When building mobile applications, you often need to dynamically create your UI. For example, you are creating a generic conference app and you need to load the tab bar items based on the number of days a conference has. In this case, you need to create the UI at runtime, rather than design time. So how do you do it in React Native? This post shows how it can be done.

Here I have an array simulating a list of sessions for each day:

var sessions = ['iOS', 'Android', 'Windows Phone', 'Tizen']

In the real world you probably will load this from a configuration file or from the Web.

Next, we will add tab bar items to our UI based on the sessions array:

  render() {
    return (
         {, i) =>
             style={[styles.tabBarButton, this.getStyle({i}) ]} >

You can use the map() function to iterate through each item in the sessions array, and then add each tab bar buttons to the UI. The getStyle() function allows you to apply unique style for each tab bar item and is defined as follows:

  getStyle(index) { 
     //---index is a dictionary, e.g { i : 1 }         
     switch (index['i']) {

       //---return predefined styles
       case 0: return styles.button1;    
       case 1: return styles.button2;      
       case 2: return styles.button3;      
       //---return dynamic style
       case 3: return {backgroundColor: '#FCBF2E'};  
       case 4: return {backgroundColor: '#FC9626'};              
       default: return {backgroundColor: '#FCBF2E'};              

Here, I am demonstrating that the function can return either a predefined style, or you can dynamically create the style if you so desire. 

The styles used by my example are as follows:

     tabBar: {
    height: 50
  tabBarButton: {
    flex: 1,   
  button1: { backgroundColor: '#8BC051' },
  button2: { backgroundColor: '#CCD948' },

  button3: { backgroundColor: '#FDE84D' },

The figure below shows the UI with 4 tab bar items and 3 tab bar items (just remove the last item in the sessions variable).