Using Resource Files

Team-Fly

Another form of persistent storage is resource files. Accessing resource files is very simple, but they are important nevertheless. Resource files can be images, text, or other types of files that are stored in a MIDlet suite JAR.

You can access a resource file as an InputStream by using the getResourceAsStream() method in Class. A typical usage looks like this:

 InputStream in = this.getClass().getResourceAsStream("/Robotag-t.png"); 


Team-Fly


Wireless Java. Developing with J2ME
ColdFusion MX Professional Projects
ISBN: 1590590775
EAN: 2147483647
Year: 2000
Pages: 129

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net