Bohemian
Bohemian

Reputation: 6067

BlackBerry - Location/directory on device to save file from application

My program saves a file on the device during runtime and reads/writes data from it during runtime. Currently it gets saved in the SDCard. I want to know if saving it in device flash memory would be better than removable media. Does device allows us to write something in its internal memory? Suggestions/Ideas? Thanks

Upvotes: 0

Views: 1321

Answers (2)

Tamar
Tamar

Reputation: 2066

We check, if there's an SDCard available we store there:


if (((FileConnection) Connector.open("file:///SDCard/", Connector.READ_WRITE)).exists())
    return "file:///SDCard";
else
    return "file:///store/home/user";

EDIT: See more information on different locations here

Upvotes: 2

Richard
Richard

Reputation: 8920

Support for an on-device file system is OS dependent. Most of the pre-3G devices don't have much internal memory anyway. If the amount of data is small (a few hundred kB) the best way is the PersistentStore. If it is larger than that, and you want to support the widest number of models then the SDCard is the way to go.

Upvotes: 1

Related Questions