System News
Design and Implementation of an Image Cache for MIDP
To Minimize MIDP Application Size
June 12, 2007,
Volume 112, Issue 2

resources can be download the first time the application runs, or just on-demand when needed using lazy initialization, storing such resources locally for later use
 

A new tech tip on the SunSM Developer Connection (SDN) illustrates how to reduce the size of applications to lower the overall MIDlet suite size. C. Enrique Ortiz explains using a local cache and utility classes such as ImageRmsUtils.java and NetworkUtils.java.

Ortiz states "the local cache covered in this article uses the code and the lessons previously covered in the article Externalizing Resources - Persisting Images in RMS. Note that the concepts described here are applicable to other types of resources beyond images." A link to that previous article is on the SDN site in his tech tip, "Implementing a Local Cache to Manage Resources".

Figures online show image cache inheritance and association, ImageCache RMS record store formats and an image cache block diagram.

Code shows steps such as how to load an image from the image cache and finding the Uniform Resource Identifier (URI) over the network.

An additional section of the tech tip explains the image cache Java files ImageCache.java and ImageCacheListener.java. Also covered is the setListener() method, the ImageCacheListener interface, ImageCache public methods and how to clear the cache and check for expiration of image resources.

Be sure to see the list of considerations and possible enhancements Ortiz concludes with. The tech tip is at this link online.

Read More ... [...read more...]

Keywords:

fullsource
 

Other articles in the Developer section of Volume 112, Issue 2:

See all archived articles in the Developer section.

Popular Articles in
Vol 194, Issue 2
Popular IT Articles





Popular Articles in
Vol 194, Issue 2
Popular IT Articles


News and Solutions for Users of Solaris, Java and Oracle's Sun hardware products
Just the news you need, none of what you don't – 42,000+ Members – 24,000+ Articles Published since 1998