12-11-2008 06:21 AM
I would like to store some temporary files and not sure if there is some temporary directory that I could use?
Thank you for your help.
Solved! Go to Solution.
12-11-2008 06:55 AM
In blackberry device memory there is no filesystem like FAT, FAT32, NTFS etc.
Blackberry device memory is like a big hashtable.
I recommend to look at Blackberry Developer Guide (there are 2 books/parts).
It can be downloaded here:
Check the part 2. There is information how to work with persistent memory.
12-11-2008 07:53 AM
You will find that all current BlackBerries support JSR 75 - FileConnectionAPI, which will provide you with a file oriented storage mechanism.
The documentation that tbilisoft has pointed you at will not mention this, as it is filially old, but you will find more current documentation here:
There is some information about FileConnection API in the multimedia guide. In addition, you find further information on this forum and in the Javadocs and on the web, since this is not a Blackberry specific API.
12-11-2008 03:54 PM
Hi Peter & Tlibisoft,
Your info is really helpful to me. I think I have a good idea of where to start already. I want to develop an application that can work on a phone with SDcard or without SDcard therefore I was looking for a common directory to put my files.
From reading the document, it seems that I can put the file in directory "file:///store/home/user/" and that directory will be common to all devices, am I right?
12-11-2008 04:19 PM
This KB article will be of use.
How To – Programmatically determine if a microSD card has been inserted
Article Number: DB-00560
I'm not 100% sure that /store is available on all devices. It is clearly not available on devices with OS pre 4.2. However the case of OS's after 4.2 is not certain. For example, you can run OS 4.5, which in theory supports FileConnection, on an 8700 device, which has no SDCard. In this case, I thought you could configure some of the memory as an internal card, but I don't know how to do this, and there does not seem to be any obvious way on the 8700 with OS4.5 I have here.
If you want a method that will work on all devices, then you have go with PersistentStore.
12-12-2008 12:35 AM
As mentioned before FileConnections API is not available for RIM OS older than 4.2
And if you plan to run your application on older OS-es too then use persistent store and store java objects instead of storing files.