Welcome!

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

Reply
New Developer
mrmarkwang
Posts: 27
Registered: ‎08-26-2008
My Device: Not Specified

Why Phone.getDevicePhoneNumber() method always return null?

[ Edited ]

My BlackBerry is 8330, and I use Bell networks.

 

I want to use Phone.getDevicePhoneNumber() to get my phone number, But I always get null.

I have the sign key, and the cod file is singed.

 

I have searched from internet to find the solution,  such as

http://www.blackberryforums.com/developer-forum/91285-cannot-retrieve-phone-number-sim.html

 

But it cannot solve my problem. Because my 8330 don't use sim card, and there has no "SIM card" menu in "Option".

 

If there have anyone  could give some suggestion?

 

Thank you advanced.

Message Edited by mrmarkwang on 09-04-2008 01:51 PM
Please use plain text.
New Developer
mrmarkwang
Posts: 27
Registered: ‎08-26-2008
My Device: Not Specified

Re: Why Phone.getDevicePhoneNumber() method always return null?

There has some information about BlackBerry 8330 in Bell networks.

 

The phone number is set by below steps:

1. Dial # # and the lock code provided by Bell Mobility and press the Send key.
2. The CDMA Service Edit Screen displays. Enter the 10-digit phone number in the Mobile Directory Number field and in the IMSI_S field.
3. Press the Menu key and select Save. The phone will indicate "Write successful."  

 

I want to get the 10-digit phone number , How could I do that?

Please use plain text.
Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Why Phone.getDevicePhoneNumber() method always return null?

If I understood you right - just call to another mobile phone and check the number that is recognized as a caller phone number.
----------------
if your issue solved set "Solution" mark at the relevant post
Please use plain text.
New Developer
mrmarkwang
Posts: 27
Registered: ‎08-26-2008
My Device: Not Specified

Re: Why Phone.getDevicePhoneNumber() method always return null?

[ Edited ]

I want to know my own phone number by programming.

 

My program need me to send the phone number to server, so I must should get it in my program.

 

I think it's basic function, but why not many people use it.

Message Edited by mrmarkwang on 09-05-2008 09:50 AM
Please use plain text.
Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Why Phone.getDevicePhoneNumber() method always return null?

As far as I know there is the following picture:

 

this method returns phone number that is manually typed in SIM-card properties screen.

 

But if the device has no sim card, then this method will return nothing. This method does not work with real phone number.

 

Imagine the following. If you have a device with sim-card, you may specify in SIM-card properties screen that your phone number is 911.

But your real phone number is say + 1 772 937 281 92

 

And this method will return 911

 

It won't return your real phone number.

----------------
if your issue solved set "Solution" mark at the relevant post
Please use plain text.
Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Why Phone.getDevicePhoneNumber() method always return null?

[ Edited ]

And in my experience there is no API to deal with real phone number.

 

There is api to get number that you typed manually into SIM-card properties screen.

 

If it is possible you may change your server software to get DevicePIN instead of phone number. Device PIN code can be obtained via DeviceInfo class.

Message Edited by rafo on 09-05-2008 05:52 PM
----------------
if your issue solved set "Solution" mark at the relevant post
Please use plain text.