java me - Not able to creat folder and file via code in j2me -
i trying create folder , image in j2me via code. able creat image file in emulator, when tried run code in mobile(nokia 2700)...it giving exception. code folloes.....
enumeration e = filesystemregistry.listroots(); string root = null; while (e.hasmoreelements()) { root = (string) e.nextelement(); break; } string newfilepath = "file:///"+root+filename[i]; fileconnection fileconnection = (fileconnection) connector.open(newfilepath, connector.read_write); if(!fileconnection.exists()) fileconnection.create(); else if(fileconnection.filesize() == mediasize){ fileconnection.close(); continue; }
what should creat image file in exist folder, or if possible, how creat folder in j2me.
some phones allow creation of folders , files in subfolder(s) of root. may not allowed create folder or file in root on nokia 2700.
typically, have go "other" folder on these phones. try 1 of these 2 path , filename:
file:///c:/other/myfolder/myimage.jpg file:///e:/other/myfolder/myimage.jpg
depending on whether want save phone memory (drive c) or memory card (drive e).
Comments
Post a Comment