Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 25
Registered: ‎05-19-2010
My Device: 9360
My Carrier: Vodafone
Accepted Solution

Blacberry application free space information

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?

Developer
Posts: 58
Registered: ‎09-23-2009
My Device: Not Specified

Re: Blacberry application free space information

Contributor
Posts: 25
Registered: ‎05-19-2010
My Device: 9360
My Carrier: Vodafone

Re: Blacberry application free space information

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.

 

Thanks again!!!