09-04-2009 07:49 AM
I got Uncaught Exception: java.lang.NullPointerException when run my application on device.
Application is signed.
Device: Blackberry 8320
it working fine on simulator, but after code signing, when I install my application on device,
it throws the exception.
I couldnt understand the reason, please help me in this regard.
please ask If you needed more explanation/ information.
09-04-2009 07:58 AM
* Attach the JDE/Eclipse JDE Plug-in debugger to your device and then start your application. The Debugger should show you where the error occurred.
* Have a look at the Event Log on the device (ALT + LGLG from the BlackBerry home screen). The stack trace of the NullPointerException is very likely to be in the log.
09-04-2009 08:12 AM
when I attach to debugger, there is error message "Cannot find file net_rim_app_manager.debug".
what should I do to remove this. ?
Thanks for your quick reply.
09-04-2009 08:18 AM
09-04-2009 08:59 AM
I found that the java.lang.NullPointerException occurs when I used
Phone.getDevicePhoneNumber(true) in my application.
can anyone know the reason behind this.
09-04-2009 09:08 AM
09-04-2009 09:11 AM
Straight from the RIM javadocs:
public static String getDevicePhoneNumber(boolean format)retrieves the device's phone number if present
Pay attenion to the "if present" blurb. My guess is the method returns null if it's not present and elsewhere in your app you assume the value is not null. There are a number of reasons why the device would not support inspectingits phone numbe, most of them security related. Carriers can prevent access to protect customers from malicious apps, and I assume enterprise admins could likely do the same. In general, any features that interrogates the devicefor owner's sensative information (contact info, email, phone, etc.) can not be relied on.