05-19-2010 04:50 AM
Hi, I'm writing a blackberry java application that maintains a file log inside de blackberry. I'd like to control the free space that left in the blackberry in order to delete old log files and be able to write log file continuosly without errors.
My question is that I don't know how to obtain the free espace that left in the device to manage it.
Do you know how I could do this or you could point me to a code example?
Solved! Go to Solution.
05-20-2010 02:53 AM
Thank you for your answer!!!
(FileConnection) 'availableSize()', works fine for my purposes.
I have also tried 'File.getFileSystemFreeSpace(int)' but I can only use FILESYSTEM_PATRIOT (what is this?) according to the API and when I use it in the simulator it throws the typical 'File System Error' (surprise). I've read also that applications must be signed to use this method, but I don't think that this is is the cause with the simulator. In any case I have the another working method and I have no time to play with another error in the 'well documented' API or developer RIM helps.