03-19-2009 11:21 AM
I've read through the forums, developer guides, and APIs, but I'm still looking for a few details on how FileConnection works on BlackBerrys. I'm writing an application that will work with minimal user configuration input on all devices running 4.2.1 and up.
1. Are store/ and SDCard/ always the name of the internal memory and SD card roots?
2. JSR 75 leaves open the issue of whether an application sees virtual roots that are private to itself or whether all applications share the same roots. How does it work on BBs? I've seen many examples where path names start with "/store/home/user/<app>/" or "/SDCard/BlackBerry/<app>/". Is this necessary or can my application just use "/store/" or "/SDCard/and add the file name? If the former, are there best practices documented anywhere to handle collisions among apps?
3. If files are visible across applications, are there any security layers available to protect data (I'm thinking about something analogous to how a PersistentObject can be wrapped in a ControlledAccess object when using the PersistentStore) or do we have to roll our own?
Thanks for any pointers on these questions!
Solved! Go to Solution.
03-19-2009 01:34 PM - edited 03-19-2009 02:11 PM
So here are a couple of additional questions:
4. I read on this forum somewhere that store/ is not available when a device is connected via usb and mass storage is active. Is this and other important information documented somewhere?
5. Can IT policies restrict how an application uses FileConnection, particularly for store/ and SDCard/? If so, is there any documentation about common restrictions that developers should be aware of when writing apps for general use?
6. What restrictions are there on file names (allowed characters, name length, etc.)?
03-26-2009 09:20 AM - edited 03-26-2009 09:21 AM
1. To date yes, but this could change. It is recommended to use the FileSystem.listRoots method to obtain a list of valid root file systems.
2. All applications share the same roots on BlackBerry handhelds. It is recommended that applications create their own folder to store their files in.
3. There is no access restriction built into JSR 75 that would prevent another application from opening your file. You could encrypt your data to prevent other applications from seeing your raw data. Here are a couple of examples on how this can be done:
How to - Use Basic Encryption
Article Number: DB-00107
How to - Use Advanced Encryption
Article Number: DB-00106
4. This is correct and also applies to the micro SD card.
5. IT Policies can restrict access to built in memory and the micro SD card. You can refer to the IT Policy Reference Guide section of the BlackBerry Enterprise Server Administrators guide for information on IT Policies. A FileConnection can also be restricted on a per application basis by using an Application Control Policy. This can be set on the BlackBerry Enterprise Server (for applications pushed to users) or modified by the user (Options, Advanced Options, Applications, Edit Permissions). An application can also request a permission change by using the ApplicationPermissions class.
6. BlackBerry handhelds do not have any unique filename restrictions. What works in Windows should work on a BlackBerry handheld.
03-26-2009 11:36 AM - edited 03-26-2009 11:36 AM
2. All applications share the same roots on BlackBerry handhelds. It is recommended that applications create their own folder to store their files in.
Are there any recommendations for avoiding name conflicts among apps? Suppose that I create folder /store/home/user/cool_app/ and store all my stuff there. Meanwhile, someone else creates their own cool_app and decides to use the same convention. Bad news if both apps run on the same device. A standard for being a "good citizen" when it comes to using the file system (as with any shared resource) would be very helpful.