×
Namespaces

Variants
Actions
Revision as of 09:29, 29 October 2012 by hamishwillee (Talk | contribs)

Graphics scalability approaches for Series 40 Java ME apps

From Nokia Developer Wiki
Jump to: navigation, search

This article lists methods for scaling app graphics to support different screen resolutions and orientations, and links to the Series 40 Java ME examples which utilize those techniques.

See Also

Contents

Introduction

Series 40 devices come in a number of different display resolutions, and may also support both portrait and landscape modes. This can pose compatibility, performance and resource problems for app developers unless handled with care. Luckily there are ways to overcome that complexity effectively, while still providing an optimized experience for each resolution and orientation.

This article lists a number of techniques for graphics scalability and points to the Series 40 Java ME examples utilizing those techniques. The best approach or typically a combination of approaches, and depends on the type of app in question.

Different approaches available

  • Different graphics sets for each supported resolution and orientation (this is a very common approach). Selection being made either at build time or at runtime (start-up time), depending on whether MIDlet size or number of builds is more important.
  • Runtime (start-up time) scaling of graphics - scaling images at runtime may lead to poorer quality or require processing time, except for vector graphics. Depends on the method and algorithm used!
    • Pixel mixing
    • Bilinear interpolation
  • Graphics generated/drawn with code - scaling without loss of quality. E.g.Draw Gradient in Java ME. Code-based graphics can whip up almost anything you can invent, not just linear gradients. More complex shapes require just a bit more code!
  • Scalable vector graphics http://www.developer.nokia.com/Resources/Library/Java/#!code-examples/scalable-2d-vector-graphics-scalable-2d-vector-graphics-examples.html
  • Tile based graphics, full UI constructed by repeatedly utilizing smaller graphical elements
  • Larger graphic which is either scrollable or only part is shown depending on the screen size and orientation
  • Filling edges with background color


Example apps utilizing graphics scalability

BattleTank

Racer

Explonoid

Frozen bubble

Sudokumaster

  • Different graphics sets for different screens and orientations
  • Runtime (start-up time) scaling of graphics
  • Tile based graphics, full UI constructed by repeatedly utilizing smaller graphical elements
  • Filling edges with background color

See how: http://projects.developer.nokia.com/JMESudokumaster/wiki#Handlingdifferentresolutions

PicasaViewer

WeatherApp

Version Hint

Windows Phone: [[Category:Windows Phone]]
[[Category:Windows Phone 7.5]]
[[Category:Windows Phone 8]]

Nokia Asha: [[Category:Nokia Asha]]
[[Category:Nokia Asha Platform 1.0]]

Series 40: [[Category:Series 40]]
[[Category:Series 40 1st Edition]] [[Category:Series 40 2nd Edition]]
[[Category:Series 40 3rd Edition (initial release)]] [[Category:Series 40 3rd Edition FP1]] [[Category:Series 40 3rd Edition FP2]]
[[Category:Series 40 5th Edition (initial release)]] [[Category:Series 40 5th Edition FP1]]
[[Category:Series 40 6th Edition (initial release)]] [[Category:Series 40 6th Edition FP1]] [[Category:Series 40 Developer Platform 1.0]] [[Category:Series 40 Developer Platform 1.1]] [[Category:Series 40 Developer Platform 2.0]]

Symbian: [[Category:Symbian]]
[[Category:S60 1st Edition]] [[Category:S60 2nd Edition (initial release)]] [[Category:S60 2nd Edition FP1]] [[Category:S60 2nd Edition FP2]] [[Category:S60 2nd Edition FP3]]
[[Category:S60 3rd Edition (initial release)]] [[Category:S60 3rd Edition FP1]] [[Category:S60 3rd Edition FP2]]
[[Category:S60 5th Edition]]
[[Category:Symbian^3]] [[Category:Symbian Anna]] [[Category:Nokia Belle]]

463 page views in the last 30 days.