Sunday, August 29, 2010

Uses Library missing in AndroidManifest.xml

Error:
[2010-08-29 11:38:04 - ddms]null
java.lang.NullPointerException
at com.android.ddmlib.JdwpPacket.writeAndConsume(Unknown Source)
at com.android.ddmlib.Client.sendAndConsume(Unknown Source)
at com.android.ddmlib.HandleHello.sendHELO(Unknown Source)
at com.android.ddmlib.HandleHello.sendHelloCommands(Unknown Source)
at com.android.ddmlib.Client.getJdwpPacket(Unknown Source)
at com.android.ddmlib.MonitorThread.processClientActivity(Unknown Source)
at com.android.ddmlib.MonitorThread.run(Unknown Source)

[2010-08-29 11:38:04 - ddms]null
java.lang.NullPointerException
at com.android.ddmlib.JdwpPacket.writeAndConsume(Unknown Source)
at com.android.ddmlib.Client.sendAndConsume(Unknown Source)
at com.android.ddmlib.HandleHello.sendHELO(Unknown Source)
at com.android.ddmlib.HandleHello.sendHelloCommands(Unknown Source)
at com.android.ddmlib.Client.getJdwpPacket(Unknown Source)
at com.android.ddmlib.MonitorThread.processClientActivity(Unknown Source)
at com.android.ddmlib.MonitorThread.run(Unknown Source)


Reason:
There are some library missing and have not been included in the AndroidManifest.xml file.

Fix:
Include the library in the AndroidManifest.xml file as a child element in element. for e.g. if you want to use GoogleMaps application in your application then make sure to add following child element in the element in the AndroidManifest.xml file,





if you do not add the above, then emulator would give you error and your app would not open.

ERROR/AndroidRuntime(295): Caused by: java.lang.IllegalArgumentException: MapViews can only be created inside instances of MapActivity.

Error:
ERROR/AndroidRuntime(295): Caused by: java.lang.IllegalArgumentException: MapViews can only be created inside instances of MapActivity.

Reason:
You get this error when you embed map view in your application but not extend MapActivity in your activity class.

Fix:
Extend your activity class to MapActivity.

Wednesday, August 25, 2010

Tip Calculator

A simple tip calculator
--Minimum clicks to get the tip amount
--Only bill amount needs to be entered through keyboard
--All other fields through buttons

Check out at,
http://www.appbrain.com/app/com.ad.tipcalc
or "Tip Calculator" at Market in your Android phone.