English 中文(简体)
支持多种屏幕的黑莓
原标题:Blackberry supporting multiple screens

I have developed my BlackBerry app for screen resolution 320x240. Now I need it to support screens of multiple resolutions. Where do I store images for different resolutions and access them accordingly through code, without making separate build for every screen resolution?

如果可能,请向我提供需要携带的黑贝里的各种屏幕尺寸。

最佳回答

不同的筛查决议:

240 x 240  7730
240 x 320  8220 8230 
320 x 240  8520 9300 9330 8310 8530 8830 8320 8330 8700c 8820 8800 8300 8707v 8330 8500 
curve3G 9220
360 x 400  9670 9105 9100 pearl3G
360 x 480  9800 9500 9370 9350 9780 9520 9550 9530 9670 
480 x 320  9000
480 x 360  9650 9700 9630 8900 9360 
480 x 800  9860 9850 storm3 volt
640 x 480  Bold 9900

int device_h = Display.getHeight();
int device_w = Display.getWidth();


 if(device_h==240  &&  device_w== 320 ){
 //select image of that size
  }
 else  if(device_h==480 &&  device_w== 360){
 //select image of that size
 } and so on.....

将不同图像分别放在项目复印件中。

问题回答

yea wont that increase the size of project? wat I have found is you can store images of good resolution and scale them according to the device sizes using the following code

int barW = Fixed32.div(Fixed32.toFP(bitmap.getWidth()), Fixed32.toFP(scaleW));
int barH = Fixed32.div( Fixed32.toFP(bitmap.getHeight()), Fixed32.toFP(scaleH)); 
Bitmap scaledBitmap = 
  EncodedImage.getEncodedImageResource(img).scaleImage32(barW, barH).getBitmap();

这似乎也做了以下工作:





相关问题
How does AlertListener work on Blackberry API 5.0?

Does the AlertListener interface works globally on all alerts on the blackberry device, or does it only work with alerts generated by your application? In other words, can I use this interface to ...

How to buffer audio in Blackberry?

I need to learn how to buffer audio stream from a remote server in Blackberry. There is a sample buffered playback app with Blackberry api but can you tell what url may I use to test the application?

Blackberry push notification implementation

How does one implement a push notification for a blackberry app? I heard that in order to do so I need to purchase a Blackberry Enterprise Server which costs me 1400 per year. Is this true? Where is ...

热门标签