null pointer exception when programming for android phone from processing IDE

362 views Asked by At

i am relatively new to java programming and programming for android and have been experimenting with android bluetooth comms using the Ketai library for the processing IDE specifically for use with android and tried to run the example program bluetoothcursors.pde that comes with the library but i keep getting the "application has stopped unexpectedly" error and the console indicates a null pointer exception error. The actual output is below:

FATAL EXCEPTION: Animation Thread
java.lang.NullPointerException
    at ketai.net.bluetooth.KBluetoothListener.<init>(KBluetoothListener.java:56)
    at ketai.net.bluetooth.KetaiBluetooth.start(KetaiBluetooth.java:207)
    at processing.test.bluetoothcursors.BluetoothCursors.setup(BluetoothCursors.java:80)
    at processing.core.PApplet.handleDraw(Unknown Source)
    at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source)
    at processing.core.PApplet.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:1019)

However i cant seem to see where the null pointer exception is coming from. I assume the null pointer exception relates to a variable that has not been instantiated properly. I have tried a process of elimination to try and isolate the cause but i get the same error but with slightly different source. I have also posted this question on the processing forum but have not received a reply. I just assumed that since it was part of the examples for the library it would work so maybe the error is being created somewhere else. I have tried other library examples and theses all work fine so i dont think its my setup. I also have other bluetooth programs working on android from processing but these use pure java code and are harder to follow.

I have had a look at some of the similar questions which have been sort-of helpful but i am still stuck.

I have set the correct bluetooth etc permissions and am using android version 2.3.3 and processing version 2.0.

Any help with this is much appreciated.

Cheers.

0

There are 0 answers