04-24-2012 04:32 AM
I want to develop one application.if I install it in Bold then it should give me screen resolution for bold if I installed it on torch then it should give it for torch likewise so how should I develop it?Any help?
04-24-2012 04:56 AM
Being picky here, and people often use them in this way, but
Display.getHeight();are not technically the resolution of the screen. They are the number of pixels that are contained in the screen. Screen resolution is normally expressed in a dpi (dots per inch) measure. For a BlackBerry device, you can obtain the resolution using
09-05-2012 03:04 AM
I think there are lot of discussions on forum for Designing for different screen resolutions. There were some approaches getting Display width and height and scale image based on that.
But as you have mentioned in post above there can be same screen size but different resolution. When I tried to use the Display.getHorizontalResolution() and Display.getVerticalResolution() on 9810 (OS 7) simulator, it printed 9661 for both. This might be OK because pixel density (ppm) might be same, But then, why the need for two separate functions in RIM JDE APIs
So how do we scale if we are getting same vertical/horizontal resolution?
Thanks and regards,
09-05-2012 04:06 AM - edited 09-05-2012 04:09 AM
I can't think of a good reason why a BlackBerry screen would have a different resolutions vertical and horizontal. Amongst the problems this would cause is that it would change the visible aspect ratio of square Bitmaps when displayed on screen. So I think you can safely say that the vertical and horizontal resolution will be the same and scale based on either one of these.
Edit: So why did the Blackberry developers supply both? "Just in case" is my guess. If you think about it I'm guessing you coud find an application like, say, wide screen devices designed to play only movies, where the resolution might be different. Just a thought...
09-05-2012 08:37 AM
Thanks for your reply.
If we try to use resolution e.g. we are getting X value for 9810. May this would be reference against which we can try to compare the resolutions.
Now I have another simulator for which i am getting Y value for resolution. I can calculate Y is how much % of X and scale image for both Height and Width depending upon single value. But sometimes it may not be straight forward Width may be more than Height and we may have to scale image based on 2 values (Height/Width) instead of just resolution. What's your opinion on that?
I think while designing app for multiple phones (Screen size, touch, non-touch) it would be very tough to cater to all types, we may have to have seperate builds at times depending upon requirement. Font, Layout, Images are the things which i think we need to check if we plan to target multiple phones. What could be a checklist if we plan to design for multiple devices?
09-05-2012 09:01 AM
I try to develop one code base for all devices and have the app decide at run time. The key requirements are, as you suggest
a) touch verses non touch - touch devices need larger buttons for example
b) landscape verses portrait - this will determine how much you can get displayed on a specific screen. On landscape format devices I will typically move headers and footers into the scrolling part of the screen, whereas on portrait devices you can fix the header and footer and still leave a reasonable scrolling area in between.
Other aspects are typically less important. The mechanism you suggest for scaling images works well in my experience. If you specify fonts in points rather than pixels, then they scale themselves. If you look at the width of the screens, the number of pixels varies significantly, but the physical width of all the screens is about the same (with he exception of the pearl devices), so if you scale everything according to the pixel density (i.e. resolution) then the landscape format screens just need to scroll more.
I've written a lot more about this, in one of the tutorials that you will find here:
Have a look at that and tell me what you think.