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

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.

Posts: 1,230
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone
Accepted Solution

Screen size wrong (Dev Alpha)

OK - I have this


<meta name="viewport" content="initial-scale=1.0; target-densitydpi=device-dpi; width=device-width; height=device-height; user-scalable=no;" />

A Dev Alpha is 1280 x 768 - I trust the source of this info (BB guy)


Try something dumb like this...


alert(window.innerWidth + ' x  ' window.innerHeight);


I'm getting the numbers - gimme a sec...


Stupid password thing


570 x 342



Click the like button if you find my posts useful!
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: Screen size wrong (Dev Alpha)

I don't have a dev alpha. But I can tell you on a BB10 phone it returns:


alert(window.innerWidth + ' x ' +  window.innerHeight);



Posts: 1,230
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Screen size wrong (Dev Alpha)

Are you using the meta?


I'm using similar code and getting 1/2 the numbers back


I may as well just strip out the viewport tag and see where that takes me


This is very annoying


I had to check with my BB guy about the size which was very embarrasing as I know the numbers to expect



Click the like button if you find my posts useful!
Posts: 22
Registered: ‎02-21-2012
My Device: Playbook torch 9800
My Carrier: Telus

Re: Screen size wrong (Dev Alpha)

Hi I had the same problem. you need to add the following:

	var meta = document.createElement("meta");
	meta.setAttribute('content','initial-scale='+ (1/window.devicePixelRatio) + ',user-scalable=no');

source: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-to-set-up-the-viewport-for-a...


Have a great day!

Posts: 30
Registered: ‎12-15-2012
My Device: Z10 LE, Playbook and Dev Alpha C
My Carrier: BASE

Re: Screen size wrong (Dev Alpha)

I had a similar problem and completely removed the meta viewport. Which worked, my bbUI.js app is running fine without viewport.