i want to load an image in my midlet but i want to set the path of my image in a properties file.can anyone help me how or perhaps give me an example on how to load a properties file?thanks in advance.
The MIDP APIs don't have any special support for property files, so you'll need to just open the property file as an InputStream and then parse it yourself:
You might find it more convenient to add some of your own properties to your MIDlet JAR file's manifest, or to the MIDlet JAD file: you can then read them using the method getAppProperty of class MIDlet. Here's an example from one of my MIDlet JAD files:
Then my MIDlet constructor just does:
You'll have no problems if you just add a few properties. But phones reasonably expect the JAD file to be small, so if you add very large amounts of properties you may run into problems on real phones. [ November 02, 2003: Message edited by: David Price ]
Post by:autobot
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
a bit of art, as a gift, that will fit in a stocking