If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
Regular Contributor
leppa
Posts: 70
Registered: ‎02-01-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: blau.de
Accepted Solution

Need help from developers owning Q5 and Q10

Hi all,

 

Those of you who have BlackBerry Q5 and Q10, could you please compile & run this small app on your device: https://l-homes.org/~leppa/bb10/dpi.zip, and post the numbers it displays?

 

It will display screen resolution as reported by bb::device::smileyvery-happy:isplayInfo class and calculate DPI from these values. I only have Z10 but I need to know what are these values on other devices.

 

Thank you all in advance for your help.

--
With best regards,
Oleksii Serdiuk
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Need help from developers owning Q5 and Q10

No real need to run an app to find that... read this page. (And, if you haven't seen that document before, read the whole thing! :-) )

https://developer.blackberry.com/devzone/design/bb10/screen_sizes.html

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Regular Contributor
leppa
Posts: 70
Registered: ‎02-01-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: blau.de

Re: Need help from developers owning Q5 and Q10

[ Edited ]

peter9477 wrote:
No real need to run an app to find that... read this page. (And, if you haven't seen that document before, read the whole thing! :-) )

https://developer.blackberry.com/devzone/design/bb10/screen_sizes.html

Unfortunately, values reported by bb::device::smileyvery-happy:isplayInfo are different from the ones declared on that page. On Z10 it reports 14222.2 pixels per meter (~361 DPI) horizontal and 14065.9 pixel per meter (~357 DPI) vertical resolution, both of which are closer to 360 when you round to the nearest 5 (while 356 is closer to 355). That's why I need to know real values that are reported by the device (knowing whether they're the same accross one model would also be nice).

--
With best regards,
Oleksii Serdiuk
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Need help from developers owning Q5 and Q10

Ah, that old screwup. I had hoped they would have fixed that by now...

Does your code check both dimensions separately? At one point I was getting different results from the vertical axis than the horizontal. When I used height it gave results within one unit of the documented size, whereas width was off.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Regular Contributor
leppa
Posts: 70
Registered: ‎02-01-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: blau.de

Re: Need help from developers owning Q5 and Q10


peter9477 wrote:
Ah, that old screwup. I had hoped they would have fixed that by now...

Does your code check both dimensions separately? At one point I was getting different results from the vertical axis than the horizontal. When I used height it gave results within one unit of the documented size, whereas width was off.

Yes, it reports different values for horizontal and vertical DPI. So I calculate average of vertical and horizontal to get effective DPI value.

 

I made a mistake in my previous post: 357 rounds to 355. The same as 356, declared in documentation, does. So vertical resolution is, indeed, closer to the documented value than horizontal one.

 

I see that you also have Z10. I wonder if this situation is the same on square Q5/Q10...

--
With best regards,
Oleksii Serdiuk
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Need help from developers owning Q5 and Q10

Here's the result from a Dev Alpha C, which is supposed to be identical hardware to the Q10:

 

    resolution 13090.9091796875 13090.9091796875
    pixelSize 720 720
    physicalSize 55 55

That's the output of those three DisplayInfo properties, from a QML file (not using your own code).

Hope that helps!


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Regular Contributor
leppa
Posts: 70
Registered: ‎02-01-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: blau.de

Re: Need help from developers owning Q5 and Q10


peter9477 wrote:

    resolution 13090.9091796875 13090.9091796875


Thanks a lot. Again, ~332.5 DPI is closer to 335 when you round to the nearest 5, but at least horizontal and vertical values are equal.

 

Considering that Q10 and Q5 have the same screen size and pixel resolution, I will assume that values they report are the same too.

--
With best regards,
Oleksii Serdiuk
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Need help from developers owning Q5 and Q10

The problem is that some of these values are probably just stored internally in some text file in /etc, or something like that. Even if they're being read from the device, they may not be in units that give them high precision when converted to DPI.

You can probably take the documented dot pitches as being the most precise. Those likely come directly from the manufacturer's data sheets for the displays, and would in that case almost certainly be exact values.

For the Q10, that means at 0.077mm per pixel, times 720 pixels, the physical screen size is really 55.44mm and not the rounded 55mm value that DisplayInfo.physicalSize gives you. If you convert that to dots per inch, using the exact 25.4mm/inch figure, you get 329.87 which would round well to 330.

For the Z10, with 0.07125mm per pixel (should be square, so both dimensions) you get 356.49 which does indeed round down to 356.

If absolute accuracy were important, I'd personally build this data into my app (hardcoding it) and fall back on the calculated approach only if the app found itself running on an unrecognized device.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Regular Contributor
leppa
Posts: 70
Registered: ‎02-01-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: blau.de

Re: Need help from developers owning Q5 and Q10

I've ported an app which was available on Nokia N9 and Symbian phones and used BB10 port of Symbian Qt Components. The way they work is that they load different layout (margins, icon sizes, etc.) depending on device DPI rounded to the nearest 5. The guy who ported these components created layout only for Z10 and I decided to add Q10 and Q5 layouts. So it doesn't matter to me if the reported values are off if I already know how off are they. The main problem is getting to know this difference.

 

One of the solutions might be to ship the same layout three times: for DPI, DPI+5 and DPI-5 and hope that the reported values won't be off by more than 5 points from the decalred ones.

 

Anyway, one more person (who has Q10) sent me the values and they're exactly the same as you posted. As nobody else replied, I'll accept your answer as solution. Thank you.

--
With best regards,
Oleksii Serdiuk
Please use plain text.