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
Contributor
Posts: 27
Registered: ‎08-06-2010
My Device: Not Specified
My Carrier: Developer - Blackberry Mobile Application

To get device phone number

Hi all,

 

        In my application i want to retrive the device phone number. So, I used

        

                 String currentSim = Phone.getDevicePhoneNumber(true);

 

       it is working in simulator. but when am testing in BB device it not getting any thing. showing blank.

       Tell me if there any other option for getting device phone number

 

       And am using jde 4.5.0

 

       Help me,

 

 

Regards,

Sampath

Developer
Posts: 16,999
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: To get device phone number

there is no other API for it. it returns the value the user configured, if it is not configured you cannot read it.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Contributor
Posts: 27
Registered: ‎08-06-2010
My Device: Not Specified
My Carrier: Developer - Blackberry Mobile Application

Re: To get device phone number

thanks simon.

 

And also can you tell me how to retrive device sim number's ID.

 

 

thanks in advance