Implementing a Local Cache to Manage Resources

By C. Enrique Ortiz, June 2007

MIDlet resources such as images, icons, video clips, and ringtones can be stored within the MIDlet suite JAR file. But keeping such resources within the MIDlet suite itself can be expensive in terms of application size. To minimize the size of the applications, 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. Using a resource cache not only hides where and how resources are found, downloaded, and stored, but it also results in lowering the overall MIDlet suite size. Another benefit is that resources can be updated on the field.

Contents