tags:

views:

124

answers:

3

kXML is an alternative XML parser I chose to use for JavaME apps.

The XML file to be editted is inside the mobile app's own JAR. I'm using CLDC profile.

Please help

+1  A: 

if i understand your problem, you want to parse xml file that is present in your apps jar. try this.

InputStream in = this.getClass().getResourceAsStream("/sample.xml");
InputStreamReader is = new InputStreamReader(in);
KXmlParser parser = new KXmlParser();
parser.setInput(is);

but if you want to make changes in that file, i think its not possible.

Vivart
Hi. I tried your code out but it doesn't seem to work. Maybe it's because the file I'm trying to access is inside the javaME project? Do you know how to open that?
cancelledout
+1  A: 

You WILL NOT be able to modify anything that is in the mobile application JAR file.
You need to create a modified copy of the file and store it in an area you can write to (presumably, on the mobile phone file system).

QuickRecipesOnSymbianOS
A: 

better u put ur file "sample.xml" inside the "res" directory of ur project.then it will work

SIVAKUMAR.J