Developing BlackBerry applications for different screen sizes

血红的双手。 提交于 2019-12-02 07:04:37

Blackberry device resolutions can be broadly placed in two categories:

  1. Low Resolution (width less than or equal to 320px)
  2. High Resolution (width more than 320px)

This categorization conveniently allows us to maintain only two versions of the bitmaps and layouts - one for low-res devices and one for high-res devices.

Sample code for dealing with these different categories of screen resolution would be:

boolean lowRes = net.rim.device.api.system.Display.getWidth() <= 320;
if (lowRes)
{
    // The device has a low resolution screen size
}
else
{
    // The device has a high resolution screen size
}

Source: Developing applications for different screen sizes (http://docs.blackberry.com)

The the screen sizes are not the same ratios you could add multiple sized images to the project and based on the screen res use the appropriate image. (Large App Size)

If the image is a gradient and gradient portion ends at the lowest screen res you could fill the remaining background with the solid color the gradient ends with.

For controls you can use layout managers and build in styles to center and stretch controls to the width of the actual BB. Try to avoid using fixed width to make your app the most compatible. If you've developed web apps the same concepts apply.

Hope this helps.

Use calculate the position of contents using width(Display.getWidth option).Based on the screen width option ,u can position it.For images,u can resize,use images of 3 sizes

i)For Bold type of Phones ii)Storm iii)Pearl

create Images for it or else use resize option

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!