Thursday, March 03, 2011

Android : Hello World Calculator !

Here i'm going to write about how to create a worlds most simplest calculator in a very short period of time to run on Android platform.

First things first:
1. Download the Android SDK (http://developer.android.com/sdk/index.html). I Installed it to windows and i used the exe to install it. It worked pretty well :).
2. Install ADT Plugin for eclipse (http://developer.android.com/sdk/eclipse-adt.html).
3. Now try to follow and create the HelloWorld Application. (http://developer.android.com/guide/tutorials/hello-world.html). If you manage to get the required result you have done all the installation correctly.

Now to the calculator:
Follow this superb tutorial about creating the calculator in Android. http://www.brighthub.com/mobile/google-android/articles/26762.aspx

So Why am i writing another post??. I'll tell you what can go wrong.

Java.lang.NullPointerException 
at com.android.ddmlib.Client.sendAndConsume(Client.java:572)
at com.android.ddmlib.HandleHello.sendHELO(srcfile.java:142)
at com.android.ddmlib.HandleHello.sendHelloCommands(srcfile.java:65)
at com.android.ddmlib.Client.getJdwpPacket(Client.java:671)
......
Either you need to add some value to the AVD SD memory allocation or you have done something wrong in AndroidManifest.xml , It will only happen if you do not follow the tutorial instructions. And again in the emulator the application will not start or it might crash as well.

And the worlds famous question... Is Android Emulator takes agers to load. YES. Don't blame your computer or code. It takes very long time to turn up the emulator. But wait till everything loads up. When everything is done you'll see some nice wallpaper and some icons. WAIT till it appear.

Thats it for now :).

1 comment:

Aruna Tennakoon said...

it's easy to tackle NullPointerExceptions if you use a Java Exception Brake Point..