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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


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
Highlighted
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