how to create file using j2me?

Share

salamu alikom
-did any one know how to create file using j2me?
i write the following code & it executed without any error or exception
but when i go to see the file i didn't find it(this means it isn't created)

String path="file:///root1/mytxt.txt";
FileConnection fc=(FileConnection)Connector.open(path);
if(!fc.exists())
fc.create();
DataOutputStream dos = fc.openDataOutputStream();
dos.write(post_msg,0,post_msg.length);
dos.close();
fc.close();

-did any one know an emulator which ca recore amr voice??

Gazakom Alllah 7'iran

use this file path ==> "file://sdfsd/root1/" and it will work isA :)

Best wishes,
Shimaa

 

See this from Nokia Forum about FileConnection API (JSR 75)

 

example of url in real deplyment "file:///C:/Nokia/Images/Image(001).jpg", and both my previous reply and Abeer reply worked correctly on the emulator.

Shimaa