I'm working on an application, that will handle some XML files.
Ich want to store the XML files on the device. They should be downloaded via HTTP.
At the moment I'm using a "online" version:
I could take the new InputStreamReader(httpConnection.openInputStream()); and save this...
HttpConnection httpConnection = (HttpConnection) Connector.open(URL);
KXmlParser parser = new KXmlParser();
My Questions are:
Is there a specific "Home" directory for midlets on the mobile phones, where i can store the xml files?
Is there a API for handling files/directories?
i didn't find a hind in the internet...
for reading a file i'm currently using:
But its only working, when i'm packing the test.txt in my project file.
InputStream is = getClass().getResourceAsStream("test.txt");
StringBuffer sb = new StringBuffer();
// Read until the end of the stream
while ((chr = is.read()) != -1)
String str = sb.toString();
catch (Exception e)
System.out.println("Unable to create stream");
I also want to save some Settings of my Program (some choiceGroups etc).
Many Games have to use this, right? So maybe there is a simple solution...
it would be very cool, if you have some hints for me.
Even if its nothing regarding my questions, it could make sense. i'm rather a newbie