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

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

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

Hi noahhuang

 

Apologies, it seems that I should know better than to rely on documentation :smileyhappy:

 

It looks like the APIs don't contain the infomation you are after, I expect this has probably not yet been implemented in the beta OS.  For example, when I queried the HardwareInfo API, I got the following (on BB10 Alpha runnning 10.0.9.388):

 

Debug: "deviceName = "
Debug: "pin = 0x29d8d418"
Debug: "serialNumber = 0000000000070207592863"
Debug: "imei = 004402241636145"
Debug: "meid = "
Debug: "hardwareId = "

 

The APIs are probably correct, and you should check again when RIM provide another firmware release.

 

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

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

Hi,

 

Thank you.

 

Actually, I has all those codes in my application, but just can not get the information from the API. I am not sure the reason is it's a alpha device or another.

 

But I reallly appreciate your help.

 

 

Noha

 

 

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

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

If you cannot see *any* information at all from the APIs, check that you have the required permissions set in your project.  You'll need read_device_identifying_information for the handset information and read_cellular_data for SIM/network.

 

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

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

Yes,  I am very sure I checked all the permissions.

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

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

[ Edited ]

Here is my code:

data.insert("carrier", QString("%1:%2").arg(m_Env->sim->mobileCountryCode()).arg(m_Env->sim->mobileNetworkCode()));

 

Here is the result: 

"carrier":null,

 

------------

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

 

Here is the result:

"phoneNumber":null

 

Has any wrong in my codes?

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

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

data.insert("carrier", QString("%1:%2").arg(SimCardInfo(this).mobileCountryCode()).arg(SimCardInfo(this).mobileNetworkCode()));
data.insert("phoneNumber", bb::system::Phone::smileytongue:hone(this).activeLine().address());

 

Same result:

 

"carrier":null,

"phoneNumber":null

Developer
BrajeshSanodiya
Posts: 134
Registered: ‎08-03-2011
My Device: torch, Z10

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

for os version

https://developer.blackberry.com/native/reference/cascades/bb__platform__platforminfo.html

bb::smileytongue:latform::smileytongue:latformInfo p_info;
p_info.osVersion();
-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------
Developer
cmr1990
Posts: 61
Registered: ‎10-16-2013
My Device: Z10

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

What about the OS version.. how to get hold of the same?

Developer
cmr1990
Posts: 61
Registered: ‎10-16-2013
My Device: Z10

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

sorry got! didnt see brijesh's post! thanks a lot!! :smileyhappy:

Developer
BrajeshSanodiya
Posts: 134
Registered: ‎08-03-2011
My Device: torch, Z10

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

hi cmr1900,

If your issue is resolved then "Accept as Solution"

thanks in advance
-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------