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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
chintan_kanal
Posts: 54
Registered: ‎03-04-2009

Phone.getDevicePhoneNumber() returns null

Phone.getDevicePhoneNumber() api returns null instead of the phone number of the embedded sim unless user has set the same under Options->Advanced Options->Sim Card menu option of his phone.
Is there any other way to retrieve the user's phone number since it's not really feasible to depend on the user to set his phone number in the Sim card menu. If I have an app that relies on this phone number I have to explicitly ask user to enter his number and even detect if the sim got changed so that the new number is used. Thats really impractical for me and even the user so I wanted to know if there's any other way around this?
Please use plain text.
Developer
Guest
Posts: 146
Registered: ‎11-05-2008

Re: Phone.getDevicePhoneNumber() returns null

You have to stote the phone no on yyour BB(Option)!
Please use plain text.
Developer
jwargo
Posts: 394
Registered: ‎12-18-2008
My Carrier: AT&T

Re: Phone.getDevicePhoneNumber() returns null

Are you using it this way?

 

 

Phone.getDevicePhoneNumber(true)

 

 

 

 

Please use plain text.
New Developer
chintan_kanal
Posts: 54
Registered: ‎03-04-2009

Re: Phone.getDevicePhoneNumber() returns null

I get a null value for both Phone.getDeviceNumber(true) and Phone.getDeviceNumber(false) unless user has set the phone number in the sim card menu option as described.
Please use plain text.
Developer
jwargo
Posts: 394
Registered: ‎12-18-2008
My Carrier: AT&T

Re: Phone.getDevicePhoneNumber() returns null

Hmmm, that's interesting. I have never experienced that. Perhaps it's a carrier provisioning issue? I didn't have to program anything on my device to have the phone number be returned by that method.
Please use plain text.
Developer
mantaker
Posts: 1,477
Registered: ‎12-30-2008

Re: Phone.getDevicePhoneNumber() returns null

Though John Wargo worked for RIM :smileywink:, I would not agree with him.. In my experience, I never got phone number if it is not set in the phone manually by the user ..

 

Cheers.. 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Please use plain text.
Developer
johnbibs
Posts: 903
Registered: ‎02-07-2009
My Carrier: Globe Telecom

Re: Phone.getDevicePhoneNumber() returns null

same exeprience with mantaker. I need to edit it manually in the options. but you'll only do it once. :smileyhappy:
Please use plain text.
Developer
johnbibs
Posts: 903
Registered: ‎02-07-2009
My Carrier: Globe Telecom

Re: Phone.getDevicePhoneNumber() returns null

do we still need to manually edit the SIMCard info in options-advance options-Sim card on BlackBerry 5.0 API? are there any other way to retrieve the phone number without manually editing the sim info?
Please use plain text.
Developer
yako
Posts: 43
Registered: ‎01-20-2009

Re: Phone.getDevicePhoneNumber() returns null

The phone number on the sims are manually inserted, they can be wrong and be any number you like. They're effectively a tag and cannot be trusted to be correct. It is actually very common for SIM card to not contain the mobile number.

 

In the backend, sims are identified using IMSI, and it is this number that is used to identify sim card in the network as far as I am aware.

 

The mobile phone number are for us humans from needing to remember 15 digits and allows us to change phone number as needed on the same sim card.

Please use plain text.
Developer
johnbibs
Posts: 903
Registered: ‎02-07-2009
My Carrier: Globe Telecom

Re: Phone.getDevicePhoneNumber() returns null

Hi yako,

 

Thanks for your inputs. I'm aware of that. I'm just playing around with the thought that maybe in the new 5.0 API, users dont need to manually enter it. So if you're saying that it is common for simcard not to contain the mobile number, then there's no way for the API to retrieve those information automatically. 

 

Thanks. 

Please use plain text.