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
Contributor
Posts: 24
Registered: ‎11-11-2013
My Device: BB 10 -BlackBerry Z10
My Carrier: BlackBerry
Accepted Solution

How to get device info

Hello,

 

     I need to get device info like IMEI , Dvice number,version etc in my application . Could anyone tell me how should I implement this ?  

Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: How to get device info

[ Edited ]
//pro file
LIBS += -lbbdevice

 C++

#include <bb/device/HardwareInfo>

bb::device::HardwareInfo info;

qDebug() << "My IMEI:" << info.imei();

 QML

import bb.device 1.0 // or 1.2


attachedObjects: [
    HardwareInfo{
        id: info
    }
]


onCreationCompleted: console.debug(info.imei)

 More info

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



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Contributor
Posts: 24
Registered: ‎11-11-2013
My Device: BB 10 -BlackBerry Z10
My Carrier: BlackBerry

Re: How to get device info

[ Edited ]

Thanks Benecore ,   Only these lines we should add inside page in QML ?  

Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: How to get device info

[ Edited ]

Yes, only this. But attachedObjects you need to use inside Page, NavigationPane, TabbedPane etc....

 

edit:

and of course you need to link device library. LIBS += -lbbdevice



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Contributor
Posts: 17
Registered: ‎11-03-2013
My Device: z10
My Carrier: vodafone

Re: How to get device info

thanks bro...

Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: How to get device info

You're welcome Smiley Wink


If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog