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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
superdirt
Posts: 503
Registered: ‎05-17-2009
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

Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Carrier: All

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
Please use plain text.
Developer
superdirt
Posts: 503
Registered: ‎05-17-2009

Re: Retrieving the device's model name

That's what I needed. Thanks.

 

Scott

Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Carrier: All

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
Please use plain text.