Skip navigation.
Home

how to create file using j2me?

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

change the path

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

yes the problem is in the path but..

Eman, if you are working on the emulator, try this path: Go to wth and you will find appdb.Open it you will find C:\WTK22\appdb\DefaultColorPhone\filesystem\ ===> root1 so your path should begin "file://root1/" not "file://sdfsd/root1/" Try both and tell me the results! Abeer

a very good link

 

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