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
Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified
Accepted Solution

FileConnection root names and application folders

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? click "Accept as solution". Helpful? give kudos by clicking on the star.
Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: FileConnection root names and application folders

[ Edited ]

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.)? 

Message Edited by Ted_Hopp on 03-19-2009 02:11 PM



Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
BlackBerry Development Advisor
Posts: 15,700
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: FileConnection root names and application folders

[ Edited ]

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

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800779/How_to_...

 

How to - Use Advanced Encryption
Article Number: DB-00106

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800779/How_to_...

 

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.

Message Edited by MSohm on 03-26-2009 09:21 AM
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Highlighted
Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: FileConnection root names and application folders

[ Edited ]
Thanks, Mark!

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.

Message Edited by Ted_Hopp on 03-26-2009 11:36 AM



Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.