mShell Blog

25
Feb

Screen resolution independent programming

by Juerg

Since a few weeks I have a Nokia E90. This great phone has an external screen at standard S60 3rd Ed resolution of 240x320 pixels and an internal screen with 800x284 canvas size.

What a pitty when I started some of my scripts written earlier for the Nokia N70. Many of them has been written with the typical S60 2nd Ed screen resolution in mind so the app screen "hangs" somewhere in the upper left corner when running on a bigger screen. Although the script worked fine I had to go trough the code and change all constant screen coordinates or sizes to relative coordinates and sizes. All the time I saved with the quick hack to assume a constant screen size and/or orientation where eated up with the boring and time consuming adaptions for screen res. independency.

When programming for mobile phones you should always aware that screen size can be different from device to device. Also the screen orientation can change while your programm is updating the screen.

Use graph.size() to get the current screen resolution. If you are using icons (from files) it's a good idea to produce the graphics for a virtual screen resolution which should be at least  two times higher than the current standard. Before drawing the icons you can scale it with graph.size(icon, scale) or graph.size(icon, w, h).

For many applications it is also sufficient to to put the graph module in scaled mode. 

Whatever method you like better, make your application screen resolution independent!

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

m Programming

Related posts

Comments

2/26/2008 7:51:36 AM

Thats an awesome tip! Thanks.

Luke ch

2/26/2008 7:54:42 AM

I fully agree on that! I have an E61 and therefor I'm also a victim of screen-unsensitive scripts. It helpes me a lot developing screensize-independet, because it also forces you to look closer at what exactly you want to draw. And it makes your applications live longer... Smile

Cheers

Andre

2/29/2008 10:54:58 AM

ability to use vector graphics inside mShell - could help in "universal graphics an all resolutions" Smile

donatas

3/1/2008 5:55:14 AM

True!WMF or SVG Renderer would be awesome.

Andre

3/6/2008 12:19:47 PM

Nice article. But for dynamic elements (lists, menus, etc.) graph.size(icon,w,h) method is too slow and unusable.

Sergey

Add comment


 

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Powered by BlogEngine.NET 1.3.0.0


Calendar
<<  July 2008  >>
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

View posts in large calendar
Archive
Authors
Tags
Categories

Sign in