Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

The getDevicePhone method returns null

by Retired ‎02-12-2010 04:25 PM - edited ‎02-17-2010 10:08 AM (2,139 Views)


This article applies to BlackBerry® Java™ Development Environment (JDE) 4.1.


In BlackBerry JDE 4.1, the Phone class (net.rim.blackberry.api.phone.Phone) introduces a new method that retrieves the phone number of a BlackBerry wireless device:

public static String getDevicePhoneNumber(boolean format);

If the phone number is listed as Unknown in the Phone application of the BlackBerry device, the getDevicePhoneNumber() method returns null.


A new SIM card can cause the Unknown phone number.


Once the SIM card is activated, the phone number is pushed wirelessly to the device. If the phone number is still Unknown after activation, complete the following:

  1. On the device Home screen, click Options and select SIM card.
  2. Click the trackwheel and select Edit SIM Phone Number.
  3. Type the phone number and click the trackwheel to save your changes.
  4. Restart the device to have the phone number appear in the Phone application.

Users Online
Currently online: 15 members 491 guests
Please welcome our newest community members: