1

I am working on a BlackBerry App that has a lot of ImageButtons, LabelFields and MessageBoxes. What appears to be perfect on one screen size, seems a mess on the other. For instance, Vertical Field Managers that are neatly aligned center with LabelFields, are left/right aligned on bigger screens. Images that cover the width of the screen appear too small on larger screens. Is there some mechanism to auto-align and dynamically change images with respect to the screen size. Any ideas and documents that can help in this regard?

Sarah
  • 1,895
  • 2
  • 21
  • 39
  • use an if else condition. inside that for each screens , set the alignment separately with respect to the screen size.ie if(screen 320x240) - align the fields accordingly . Else if(screen 360x480) then rearrange the alignment. Else if.... and so on. – Rince Thomas Apr 04 '13 at 13:25
  • 1
    If you manage to center things they should look fine in every screen. Probably you are using some dirty tricks to do the job (that "alignment with label fields" sounds scary). And about the images, either scale them or provide a set of images for each possible screen size (yeah, it is a ton of work). If you are more used to web development, you could also consider switching to WebWorks. – Mister Smith Apr 05 '13 at 09:04

1 Answers1

2

Here are some tips for making screens that look good on almost all devices:

  1. Use less images. If you have to use images, use atleast 3-4 for different screen sizes. for example if you need to have an image as the screen header, use images with widths 320px, 480px and 640px. Load image depending on the width of the screen.

  2. Do not use pixel measurements. Use point measurements instead. Most of the devices are similar in terms of physical size, whereas they have huge difference in pixel density. Using this you can have a screen which will look exactly identical on curve (320x240), bold2 (480x360) and bold 4 (640x480). If you notice, they have the same aspect ratio and similar physical size.

  3. Do not hardcode positions. Instead use FIELD_HCENTER and DRAW_HCENTER etc for fields.

  4. Do not use fonts with fixed pixel height. Use fixed point height instead.

  5. If using custom fields, make sure that they can automatically expand according to device and pixel density.

Adwiv
  • 1,283
  • 9
  • 15
  • +1. Here's a [link to help with #1](http://stackoverflow.com/a/11551148/119114), and a [link to help with #2/4](http://stackoverflow.com/a/3497056/119114) – Nate Apr 11 '13 at 20:57