BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 08-20-2007, 02:02 AM   #1 (permalink)
New Member
 
Join Date: May 2007
Model: 7100
PIN: N/A
Carrier: Airtel
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot retrieve phone number from SIM

Please Login to Remove!

Hi all,
I am trying to retrieve the phone number from the SIM using Phone.getDevicePhoneNumber(false);
This must return the phone number in string format. It retrieves the number correctly on the simulator. But when i try it on the device(8100 handheld OS v 4.2.1), it returns null. I tried it with atleast two SIM cards but to no avail.

Can anyone tell me why this API is not working the device. The SIM cards used were active.

Awaiting response.
Thanks and regards,
Sriram
Offline  
Old 08-20-2007, 02:23 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Location: Bangladesh
Model: 8800
PIN: N/A
Carrier: EDGE
Posts: 93
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi vsriram,

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:

Code:
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.

Cause
A new SIM card can cause the Unknown phone number.

Resolution
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.

Hope this will resolve!

Cheers,
ARIF

Last edited by arifzaman : 08-20-2007 at 03:59 AM.
Offline  
Old 08-21-2007, 12:33 AM   #3 (permalink)
New Member
 
Join Date: May 2007
Model: 7100
PIN: N/A
Carrier: Airtel
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for reply arifzaman. The API worked after manually entering the number. But does this mean that the device needs to be activated to get the number? And say if my SIM does not have GPRS, will the API not be able to retrieve the phone number?
Offline  
Old 08-21-2007, 01:36 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Location: Bangladesh
Model: 8800
PIN: N/A
Carrier: EDGE
Posts: 93
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Welcome vsriram!

Quote:
Originally Posted by vsriram View Post
does this mean that the device needs to be activated to get the number?
I'm not sure. A new SIM card can cause.

Quote:
Originally Posted by vsriram View Post
if my SIM does not have GPRS, will the API not be able to retrieve the phone number?
I don't think so. GPRS never be the case.

Cheers,
ARIF
Offline  
Old 08-21-2007, 04:27 AM   #5 (permalink)
New Member
 
Join Date: May 2007
Model: 7100
PIN: N/A
Carrier: Airtel
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for reply arifzaman. The API worked after manually entering the number. But does this mean that the device needs to be activated to get the number? And say if my SIM does not have GPRS, will the API not be able to retrieve the phone number?
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Non-Contact Voltage Detector by Smart Outlet - PM8908C 12-1000V AC Tester
$13.62
Non-Contact Voltage Detector by Smart Outlet - PM8908C 12-1000V AC Tester  picturebayite DC 5-120V 100A Mini Digital Current Voltage Amp Meter Ammeter Gaug... NEW
$20.74
bayite DC 5-120V 100A Mini Digital Current Voltage Amp Meter Ammeter Gaug... NEW pictureMegger DCM330-EN CAT IV Fork Multimeter, 1000V DC Voltage, 200A AC Current
$89.99
Megger DCM330-EN CAT IV Fork Multimeter, 1000V DC Voltage, 200A AC Current picture300Pcs 15 Valus Ceramic Capacitor Assorted Kit 1KV/2KV/3KV High Voltage 20x Each
$8.39
300Pcs 15 Valus Ceramic Capacitor Assorted Kit 1KV/2KV/3KV High Voltage 20x Each pictureAuto Car Voltage Electroprobe Circuit Tester Pen DC 6V-24V H4B4
$2.35
Auto Car Voltage Electroprobe Circuit Tester Pen DC 6V-24V H4B4 picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.