Um, wouldn't you already know what you put in your jar file? You can't put in dynamic files into your jar file, and you won't be able to access someone else's jar file, so it is your and you should know what you pu tinto it. Just my opinion. Mark
I made midlet which shows few images as a slideshow. My chef has source codes and wants to create another application just by changing images. I'd like to develop midlet which loads file names and than shows images, so that my chef can only copy images and build (without changing source code). Do I make myslef clear?
I see two options: 1) Make defining the file names a part of the build process -- when your chef(?) builds the application, he needs to edit some text file listing all the images the midlet should display. 2) Rip the images out of the JAR file and place them on a web server for download. For example, the midlet could be pointed to a "gallery" URL where it would download a "gallery descriptor" document (lists the URLs and names for the images that are part of that particular gallery) and then proceed to download each individual image file. The midlet could store these images and the descriptor into RMS for persistent storage.
Yes, Lasse, I like your Images on a web server idea the best. Other than that, you will not be able to dynamically create a Jar file with file names you don't know, and expect to be able to find out what those filenames are. Mark
Lasse, thank for your reply, but I said that I want my chef not to edit src code. Application should find filenames itself. And downloading from internet is for this type application the worst solution, 'cause it's offline midlet and downloading brings more problems ect.
Like Mark and Lasse had stated, there is no way to dynamically discover filenames in a MIDP JAR file. I would suggest to write a more flexible build solution: You can write an ANT task which would re-generate part of your source code based on your current image names. That is not that difficult and would save you (or your client) from editing the source code.
Yes, I just wanted to know if it is possible or not. Never mind. I wanted to help my chef with building new slideshow apps as easy as possible. It seems, that the easiest way how to do it is modifying source code. After all, it is just few (5-10) lines.
Another idea... You could enforce a naming convention for the images (e.g. slide-1, slide-2, slide-3, ...) and have your MIDlet try to "guess" the names by reading files in order until slide-n is missing.