April 15, 2007, 8:05 p.m.
posted by barateon
20.3 Application Resource FilesMIDP provides the capability of storing resources in the application's JAR that can be accessed by a MIDlet at run time. An example of such a resource might be a locale bundle, an icon, or a graphical image; however, any thing that can be accessed as an InputStream can also be stored. These resources are accessed using the method getResourceAsStream(String name) of class java.lang.Class. The rules and the parameter string format for accessing resources inside a JAR file have been discussed in Section 19.1.4, "MIDlet Suite Execution Environment." As a general rule, if the parameter string to the getResourceAsStream method begins with a '/', the search for the resource begins at the "root" of the JAR file; however, if it does not begin with a '/', the resource is searched for along a path relative to the class instance retrieving the resource. |
- Comment