views:

26

answers:

1

Hi Java programmers. I badly need your help.

I have a JavaFX/Java ME application. I'm trying to modify an XML file inside my project's folder (soon to be packaged jar file).

The path of the file I want to write: /parseExample/service1.xml

Sadly, my application is a JavaFx/JavaME so it doesn't contain the library java.util.jar. So I can't use the jar classes.

Are there other ways to do that?

+1  A: 

Even in J2SE you should consider a Jar file as read only. In J2SE the only way to do it is either using external tools or recreating a new Jar file and overwriting the old one with the new.

My recommendation would be to find a storage location as listed below and use your XML file as a default, if you need to change the just put the new one in the storage location.

Your data storage options are the following:

As per http://developer.android.com/guide/topics/data/data-storage.html These are the possible storage locations you have available:
Shared Preferences - Store private primitive data in key-value pairs.
Internal Storage - Store private data on the device memory.
External Storage - Store public data on the shared external storage.
SQLite Databases - Store structured data in a private database.
Network Connection - Store data on the web with your own network server.

Romain Hippeau