Hi all,
I want to write the data to a separate file using fileconnection. Is it posssible?
Hi all,
I want to write the data to a separate file using fileconnection. Is it posssible?
Sure, with FileConnection API you can write files. Maybe this Wiki article can help you:
http://wiki.forum.nokia.com/index.ph...tion_&_PIM_API
Pit
Hi
String url = path + name;
String string = textbox.getString();
byte data[] = string.getBytes();
FileConnection fconn = (FileConnection)Connector.open("file://d:/readme.txt;append=true", Connector.READ_WRITE);
if (!fconn.exists()) {
fconn.create();
}
OutputStream ops = fconn.openOutputStream();
ops.write(data);
ops.close();
fconn.close();
} catch (IOException ioe) {
System.out.println("IOException: "+ioe.getMessage());
} catch (SecurityException se) {
System.out.println("Security exception:" + se.getMessage());
}
This is the code i have tried. There is no error in the application. While execution java.lang.IllegalArgumentException: Root is not specified. This msg is displayed. Please tell me if any modification needed.
If you're testing on WTK emulator you should use its root path, so file path
becomes: "file:///root1/readme.txt"
To check for emulator filesystem go to: <WTK_ROOT_PATH>\appdb\<EMULATOR_NAME>\filesystem\
Pit
Hi Dinesk,
try searching Forum for your doubts, since many answers are already there:
http://discussion.forum.nokia.com/fo...d.php?t=131778
Pit