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

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Contributor
Posts: 8
Registered: ‎09-27-2012
My Device: BB 10 Dev Alpha
My Carrier: Roger

Does anyone know how to get BB10's OS version, Phone number and Carrier information through API?

AS title.

 

 

 

Developer
Posts: 671
Registered: ‎03-21-2012
My Device: BlackBerry PlayBook 16GB
My Carrier: Vip

Re: Does anyone know how to get BB10's OS version, Phone number and Carrier information through API?

[ Edited ]
New Contributor
Posts: 8
Registered: ‎09-27-2012
My Device: BB 10 Dev Alpha
My Carrier: Roger

Re: Does anyone know how to get BB10's OS version, Phone number and Carrier information through API?

[ Edited ]

bb::system :: phone::Phone phone;

bb::device::HardwareInfo hardware;

 

 

data.insert("carrier", phone.activeLine().description());

data.insert("phoneNumber", phone.activeLine().address());

data.insert("phoneType", hardware.deviceName());

 

This three fields returned a empty string on Dev Alpha device and Simulator.

"carrier":null

"phoneNumber":null

"phoneType":null

New Contributor
Posts: 8
Registered: ‎09-27-2012
My Device: BB 10 Dev Alpha
My Carrier: Roger

Re: Does anyone know how to get BB10's OS version, Phone number and Carrier information through API?

bb::

PackageInfo packageInfo;

 

data.insert(

"osVersion", packageInfo.systemDependency());

 

 

This can get

"osVersion":"10.0.9.0"

Developer
Posts: 671
Registered: ‎03-21-2012
My Device: BlackBerry PlayBook 16GB
My Carrier: Vip

Re: Does anyone know how to get BB10's OS version, Phone number and Carrier information through API?

This should check whether phone data(carrier, phone number etc) is available https://developer.blackberry.com/cascades/reference/bb__system__phone__phone.html#islineavailable

but I don't know whether the api is supported on hardware.
Developer
Posts: 100
Registered: ‎10-01-2012
My Device: BB10 Dev Alpha
My Carrier: Roger

Re: Does anyone know how to get BB10's OS version, Phone number and Carrier information through API?

From the setting function --> general

I can see the phone number, provider... all the information I need. Just cannot get it from API.

 

Not sure, cause by this is a dev device or not..

Highlighted
New Contributor
Posts: 5
Registered: ‎11-08-2012
My Device: BB10 Dev Alpha
My Carrier: Vodafone

Re: Does anyone know how to get BB10's OS version, Phone number and Carrier information through API?

You can obtain the OS version by using the BlackBerry Platform Services API to obtain deviceinfo, which in turn can be used to obtain OS version:

 

http://developer.blackberry.com/native/beta/reference/com.qnx.doc.bps.lib_ref/com.qnx.doc.bps.lib_re...

 

http://developer.blackberry.com/native/beta/reference/com.qnx.doc.bps.lib_ref/com.qnx.doc.bps.lib_re...

Developer
Posts: 100
Registered: ‎10-01-2012
My Device: BB10 Dev Alpha
My Carrier: Roger

Re: Does anyone know how to get BB10's OS version, Phone number and Carrier information through API?

Thank you. I can get OS version, but I can not get these three

 

data.insert("carrier", phone.activeLine().description());

data.insert("phoneNumber", phone.activeLine().address());

data.insert("phoneType", hardware.deviceName());

New Contributor
Posts: 5
Registered: ‎11-08-2012
My Device: BB10 Dev Alpha
My Carrier: Vodafone

Re: Does anyone know how to get BB10's OS version, Phone number and Carrier information through API?

You should be able to retrieve the device name using the HardwareInfo API call deviceName()

https://developer.blackberry.com/cascades/reference/bb__device__hardwareinfo.html

 

...and you can get hold of the network code using the SimCardInfo API call mobileNetworkCode()

https://developer.blackberry.com/cascades/reference/bb__device__simcardinfo.html

 

...and for phone number, it looks like Line.address() is what you're after.  You can get hold of the Line object using the Phone API

https://developer.blackberry.com/cascades/reference/bb__system__phone__phone.html

https://developer.blackberry.com/cascades/reference/bb__system__phone__line.html

 

Please 'like' if this assists you.

 

New Contributor
Posts: 5
Registered: ‎11-08-2012
My Device: BB10 Dev Alpha
My Carrier: Vodafone

Re: Does anyone know how to get BB10's OS version, Phone number and Carrier information through API?

Just to clarify, using the SimCardInfo API, you'll need to map the mobileNetworkCode (MNC) in combination with the mobileCountryCode (MCC) to a list of carriers if it's the verbose name of the carrier company that you're after.

http://en.wikipedia.org/wiki/Mobile_Network_Code