Developing BlackBerry applications for different screen sizes

前端 未结 3 394
日久生厌
日久生厌 2021-01-25 00:40

I am developing an application on JDE 4.5. The 4.5 OS is supported by the Pearl, Curve and Huron so the application which I am developing will support all the above devices. The

3条回答
  •  抹茶落季
    2021-01-25 01:04

    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)

提交回复
热议问题