站内搜索: 请输入搜索关键词
当前页面: 图书首页 > MIDP Style Guide for the Java 2 Platform, Micro Edition

MIDP Style Guide for the Java 2 Platform, Micro Edition

[ directory ] Previous Section Next Section

10.5 Accommodating Different Screen Sizes

Relying on a particular screen size is inadvisable even for application developers who are designing an application for a specific MID. Even a single device can give an application different amounts of the screen at different times. For example, in Sun's MIDP for Palm OS, consumers can turn on application buttons or game controls, both of which impact the amount of available screen real estate. Figure 10.12 shows the Push Puzzle game with and without the phone keypad on the screen. Changes in screen size can also take place if an application moves to and from full-screen mode.

Figure 10.12. Unstructured Screen with and without Phone Keypad

graphics/10fig12.gif

Application Developers:

Strongly Recommend: graphics/bulb1_icon.gif Do not assume a particular size of device screen when designing a Canvas screen. Applications that assume a particular size of screen are not necessarily portable.

Even if you assume a small screen size, your application will not necessarily be usable on all MIDs. For example, Figure 10.13 shows a Push Puzzle game that expects a small screen. It is awkward when displayed on a mobile phone with a larger screen.

Consider: Use a scaled graphic instead of a bitmap, when possible, for graphics that will be drawn onto a canvas. Because different MIDs have different screen sizes, an application that uses a small scalable graphic and then scales it up for larger screens is more portable.

Figure 10.13. Canvas Designed for a Small Screen on a Large Screen

graphics/10fig13.gif

    [ directory ] Previous Section Next Section