Life is easier with QR Codes

You are welcome once again to today’s information session. I will start by asking if you have a smart phone?
If your answer to my question is yes it is most likely that you have never used it to scan a QR Code.

What is a QR Code(QRC)?

QRC stands for Quick Response Code and in simple terms It is a way of encoding information such as website links or web systems
so that other devices such as smartphones can gain easy access to the system. You still do not understand? Okay, i will give an example.
Let us assume you run a business that has a  website and you want your clients to be able to visit you website through their smartphones; there are two ways i can think of right now of achieving such:

1. Giving them the link to your website(by mouth, on paper and through SMS/email) and then they copy and paste that on
the browser application on their smartphones (mozilla firefox, internet explorer and several others) to be able to view your website.

2. Giving them a thank you note that has printed on it a QR Code.

Despite the fact that many may be used to the first method, I definitely see the second as a faster, easier and a more professional option. First is because it will enable you direct the client at every point in time to what you exactly want them to see on your website. In this case if you want them to respond to a question, they do not need to click a question button by the side when they get to the site, the code takes them straight to the question or the item you want them to see at that particular point in time.

How do i read a QR Code?

You can read a QRC using the following simple steps:

1. Download and install a QR code reader from the respective app store.
For android smartphones you should be familiar with an image like the one shown below.

Scan QR
http://www.wikihow.com/Scan-a-QR-Code

2. When the QRC reader is launched, place your phone camera against any QR Code be it on your computer or on paper and your phone will automatically read and interpret the code.

http://www.wikihow.com/Scan-a-QR-Code
http://www.wikihow.com/Scan-a-QR-Code

Do you want to grow your business by using this technology? Would you like to have it as a free version or you do not mind paying? Get your your comment and feedback across.

Android Currency USD to NGN naira converter

Getting ones and on an android application development feels good sometimes, especially when you have been able to scale through the hurdles of the initial setup of eclipse.

Here we have a simple android application that converts the US dollars to the Nigerian naira. Although the rates are currently being hard-coded, an upgrade is going on to fetch them online and that would be released soon. And this application could also be enhanced to convert in more than one currency.

Going through the process of the development of this application, although so much dependent on an existing example, in a way I thought there was no need putting it on my blog but on another note I felt it would be a good platform for  android newbies to move a step further.

Now go on with me to the next step as I explain an easy way of achieving this or even something greater.

Steps

1.       Get eclipse IDE(Integrated Development Environment) installed on your system

I have had ,Eclipse Java EE IDE for Web Developers. Version: Helios Service Release 2 Build id: 20110218-0911’ on my system for some time now and believe me, it has really being a great tool to work with having used it for a lot of developments out of android. In building this application all I needed to do was to complete the needed setup for the android part of eclipse and then was I able to fire on with my development. You might decide not to use eclipse for your own development, but giving it a trial is not in any way bad as well. To download and install eclipse, this is the link. http://www.eclipse.org/downloads/

2.       Get Android installed and configured.

After you have downloaded the needed version of eclipse( usually Eclipse Classic 3.5 (Galileo)) the next step is to go ahead and make the necessary android installation and configuration. The link below should help you in doing that. http://www.londatiga.net/it/how-to-setup-android-application-development-on-eclipse/   Please note that for people in countries like Nigeria in which people do not really have extremely fast bandwith, there might be some challenges in achieving the first two steps above and I bet you, one might not be able to move a step further without getting them set.  

3.       Set up an emulator

The purpose of this is to be able to test you application during and after development and see it the way it would work on an android appliance. http://grail.cba.csuohio.edu/~matos/notes/cis-493/lecture-notes/Android-Chapter02-Setup2-Emulator.pdf

4.       Make your application

Depending on the complexity of the app you want to develop, which I believe should not be complicated at this time, eclipse  avails you the opportunity to easily get an application built in no time.   In eclipse, create a new android project and paste the code below into the script below into the res/layout/main.xml file .  

<?xml version=“1.0” encoding=“utf-8”?>

<RelativeLayout

android:id=“@+id/widget32”

android:layout_width=“fill_parent”

android:layout_height=“fill_parent”

xmlns:android=http://schemas.android.com/apk/res/android&#8221;>

<LinearLayout

android:id=“@+id/widget34”

android:layout_width=“250dp”

android:layout_height=“350dp”

android:layout_alignParentLeft=“true”

android:layout_alignParentTop=“true”

android:orientation=“vertical” >

<TextView

android:id=“@+id/dollar”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“”

android:hint=“USD” />

<EditText

android:id=“@+id/dollars”

android:layout_width=“100dp”

android:layout_height=“40dp”

android:text=“100”

android:textSize=“18sp” />

<TextView

android:id=“@+id/nair”

android:layout_width=“100dp”

android:layout_height=“30dp”

android:text=“NGN”

android:textSize=“18sp” />

<EditText

android:id=“@+id/naira”

android:layout_width=“100dp”

android:layout_height=“40dp”

android:text=“160”

android:textSize=“18sp” />

<RadioGroup

android:id=“@+id/widget48”

android:layout_width=“210dp”

android:layout_height=“80dp” >

<RadioButton

android:id=“@+id/dton”

android:layout_width=“200dp”

android:layout_height=“30dp”

android:text=“USD to NGN” />

<RadioButton

android:id=“@+id/ntod”

android:layout_width=“200dp”

android:layout_height=“30dp”

android:text=“NGN to USD” />

</RadioGroup>

<Button

android:id=“@+id/convert”

android:layout_width=“100dp”

android:layout_height=“40dp”

android:layout_marginRight=“26dp”

android:layout_marginTop=“16dp”

android:text=“Convert” />

</LinearLayout>

</RelativeLayout>

After that, copy the following code and paste it in a default java file that eclipse created.  

package com.tunji.android;

import android.*;

import android.app.Activity;

import android.view.View;

import android.view.View.OnClickListener;

import android.widget.Button;

import android.widget.RadioButton;

import android.widget.TextView;

import android.os.Bundle;

public class CurrencyActivity extends Activity implements OnClickListener {

TextView dollars;

TextView naira;

RadioButton dton;

RadioButton ntod;

Button convert;

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle icicle) {

super.onCreate(icicle);

setContentView(R.layout.main);

dollars = (TextView)this.findViewById(R.id.dollars);

naira = (TextView)this.findViewById(R.id.naira);

dton = (RadioButton)this.findViewById(R.id.dton);

dton.setChecked(true);

ntod = (RadioButton)this.findViewById(R.id.ntod);

convert = (Button)this.findViewById(R.id.convert);

convert.setOnClickListener(this);

}

public void onClick(View v) {

if (dton.isChecked()) {

convertDollarsToNaira();

}

if (ntod.isChecked()) {

convertNairaToDollars();

}

}

protected void convertDollarsToNaira() {

double val = Double.parseDouble(dollars.getText().toString());

// in a real app, we’d get this off the ‘net

naira.setText(Double.toString(val*157.00));

}

protected void convertNairaToDollars() {

double val = Double.parseDouble(naira.getText().toString());

// in a real app, we’d get this off the ‘net

dollars.setText(Double.toString(val/157.67));

}

}

5.       Run your application and view your application if there are no hitches.

Although there is a slim chance of everything working smoothly at the very first attempt, here are some links below that could assist in some of the challenges you face. It is however important that you find out what a problem is by searching and reading about the error messages or logs before you start troubleshooting. Else, you might end up muddling up all the application and not knowing where to go from there.   http://www.coderanch.com/t/510807/Android/Mobile/Could-not-find-HelloAndroid-apk http://stackoverflow.com/questions/2793956/android-emulator-wont-run-application-started-from-eclipse I hope this helps, please post your comments and observations and let me know if this helps you. I am also available to assist further if you are experiencing some other forms of challenges as regards this.  

Regards