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
Developer
superdirt
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified
Accepted Solution

Retrieving the device's model name

Hello,

 

Is there a way to retrieve the name of the device in use? I would like to be able know if the user is using a Z10, Q10 etc..

 

Thanks,

Scott

Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900

Re: Retrieving the device's model name

Have you tried with HardwareInfo?

 

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




p(^_^)q
Good good study, day day up
Developer
superdirt
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: Retrieving the device's model name

That's what I needed. Thanks.

 

Scott

Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900

Re: Retrieving the device's model name

I just found another solution for this requirement. By this solution, it can also retrieve other system information as well such as os version (deviceinfo_details_get_device_os_version).

 

QString deviceModel;

    if (bps_initialize() == BPS_SUCCESS) {
        qDebug() << "bps initialized";
        deviceinfo_details_t *deviceDetails = 0;

        if (deviceinfo_get_details(&deviceDetails) == BPS_SUCCESS) {
            deviceModel = deviceinfo_details_get_hardware_id(deviceDetails);
            deviceinfo_free_details(&deviceDetails);
        } else {
            qDebug() << "error retrieving device details";
        }

        bps_shutdown();
    } else {
        qDebug() << "error initializing bps";
    }

 




p(^_^)q
Good good study, day day up