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
dhiraj_n
Posts: 24
Registered: ‎11-11-2013
My Device: BB 10 -BlackBerry Z10
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 ?  :Helpsmilie:

Please use plain text.
Developer
Benecore
Posts: 540
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....

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
Please use plain text.
Contributor
dhiraj_n
Posts: 24
Registered: ‎11-11-2013
My Device: BB 10 -BlackBerry Z10

Re: How to get device info

[ Edited ]

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

Please use plain text.
Developer
Benecore
Posts: 540
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....

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
Please use plain text.
Contributor
deepak_khatri
Posts: 17
Registered: ‎11-03-2013
My Device: z10

Re: How to get device info

thanks bro...

Please use plain text.
Developer
Benecore
Posts: 540
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....

Re: How to get device info

You're welcome :smileywink:


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