I am using the FileConnection API with J2ME to write to a file on your phone
NOKIA C5-03. With this phone works perfectly.
Now I'm having problem with the Nokia 500, mobile phone will replace the C5-03.
The application does not create the file.
Below the code I'm using.
Code:private static String PATH_FILE_MEMORY_CARD = "file:///Memory card/Others/Araujo/"; public static void saveFile(String batLvl, String path) { try { try { filedir = (FileConnection) Connector.open(PATH_FILE_MEMORY_CARD, Connector.READ_WRITE); if(!filedir.exists()) { filedir.mkdir(); filedir.close(); } } catch (Exception e) { FileConnectionUtil.logString("7.(FileConnectionUtil) " + e.getMessage()); } file = (FileConnection) Connector.open(PATH_FILE_MEMORY_CARD + path , Connector.READ_WRITE); try { file.create(); } catch (IOException io) { try { file.delete(); file.create(); } catch (Exception e) { FileConnectionUtil.logString("8.(FileConnectionUtil) " + e.getMessage()); } } if (file.canWrite()) { OutputStream out = file.openDataOutputStream(); out.write(batLvl.getBytes(), 0, batLvl.getBytes().length); out.close(); file.close(); } } catch (IOException ex) { FileConnectionUtil.logString("9.(FileConnectionUtil) " + ex.getMessage()); } }
Does anyone know how to help me find out what may be happening?
Do you have any way to plug the phone into the computer and debug the application in any IDE, like Eclipse, Netbeans ..?

Reply With Quote

