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 Developer
Posts: 31
Registered: ‎06-13-2014
My Device: Z30
My Carrier: Telus
Accepted Solution

How to tell what BB10 device app is running on?

With all the proliferation of new BB10 devices, all with different physical characteristics, surely there must be an easy way to determine what physical device type an app is running on, at run time. Dashed if I can find it, though, and no amout of searching through the board messages or SDK docs seems to give me any clue.

Can someone please tell me how you do this, either in QML or C++.

BlackBerry Development Advisor
Posts: 15,699
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: How to tell what BB10 device app is running on?

The HardwareInfo class will get you that information.  Here's an example and what you'll see.

 

bb::device::HardwareInfo* hw = new bb::device::HardwareInfo(this);

qDebug() << "Model Name: " << hw->modelName();
qDebug() << "Model Number ID: " << hw->modelNumber();

 Prints out:

 

Model Name:  "Z30" 
Model Number ID:  "STA100-1" 

 

 

 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Highlighted
New Developer
Posts: 31
Registered: ‎06-13-2014
My Device: Z30
My Carrier: Telus

Re: How to tell what BB10 device app is running on?

Well duh! Why didn't I think of 'hardware' as a tag. I knew there must be something like that somewhere.
Thank you.