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

Web and WebWorks Development

Reply
Developer
Posts: 23
Registered: ‎01-05-2013
My Device: 9800
My Carrier: IDEA

Re: How to target BB Q10

Uploading one application for Q10 and Z10 is good approach, It will reduce burdan of maintain and manage two app or two asset bundles. 

Developer
Posts: 172
Registered: ‎05-01-2010
My Device: Z10
My Carrier: O2

Re: How to target BB Q10

Hi,

 

I try to achieve the same - how to detect the Q10? The only "usable" thing that I found yet is "blackberry.system.hardwareId;" and I get something like "0x8700240a". How can I know if this is a Q10, Z10 or Q5? May be the number changes between carrier as well?

 

Anyone solved this in a nice way?

 

Thanks.

 

bert2002



----------------------------------------------------------
find my widgets -> http://blackberry.itbert.de
Developer
Posts: 172
Registered: ‎05-01-2010
My Device: Z10
My Carrier: O2

Re: How to target BB Q10

This seems to work very well:

	if (window.innerWidth == 720 && window.innerHeight == 720) {
		//Q10
	} else {
		//Z10
	}

 



----------------------------------------------------------
find my widgets -> http://blackberry.itbert.de
New Developer
Posts: 11
Registered: ‎03-14-2013
My Device: z10 , q10
My Carrier: vodaphone

Re: How to target BB Q10

[ Edited ]

agree,

according to guidelines

https://developer.blackberry.com/devzone/files/design/bb10/UI_Guidelines_BlackBerry_10.pdf

the screen size will be 720 x 720 pixels, so we can rely on screen size in this case

 

if (display.pixelSize().width() == display.pixelSize().height()) {
qDebug() << "Q 10";
imglogo->setVisible (false);

} else {
qDebug() << "Z 10";

}