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

Some questions about FileConnection/JSR 75

[I posted these questions a while ago but got no response]

 

I'm writing an application that will target 4.2.1 and up. After reading all I can find (api docs, forum, kb, guides, web search), I still have lots of questions about the BlackBerry file system:

 

  1. Are store/ and SDCard/ the name of the internal memory and SD card roots on all BlackBerry devices?
  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_name/" or "/SDCard/BlackBerry/app_name/". 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 app names?
  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?
  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 information like this documented somewhere?
  5. Can IT policies restrict how an application uses FileConnection, particularly for store/ and SDCard/? If so, is there any guidance available 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, length, etc.)?
Any guidance or pointers will be appreciated!



Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Please use plain text.
Developer
jhaehnle
Posts: 238
Registered: ‎08-26-2008
My Device: Not Specified

Re: Some questions about FileConnection/JSR 75

Hi Ted,

 

i'm not quite sure on your open questions, but i'll try to answer them best i can:

 

1. Haven't had any different namings on devices till today.

2. You don't have any problems on SDCard and you are allowed to save files anywhere there. Not quite sure

about store, but you should be able to save files on viewable file system and own created folders. There will be

some unreachable folders which the devices need for internal processing (f.e. installed applications etc.).

3. You can open files as readonly etc. but elsethere there aren't any security layers installed. If you have data

regarding security issues, you should save that f.e. using class RuntimeStore!

4. I don't know, but that is a fact. But therefor you can detect the mass storage activation/deactivation

programmatically.

5. See point no.3

6. See restrictions as specified in JSR 75.

 

Regards,

Jochen

Please use plain text.
Developer
Ted_Hopp
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: Some questions about FileConnection/JSR 75

Thanks for the info, Jochen. I've been experimenting with the simulator, and have observed the following.

  1. The file system under store is shared by all applications. If you put something there, any other app can see it.
  2. The object returned by Connector.open("file:///...") implements the ExtendedFileConnection interface, which provides encryption and DRM capabilities. The docs seem to say that behavior on the store and SDCard file systems will be different in some areas; I haven't experimented with this yet.
  3. When an application is removed, any files or folders it created are not removed by the system. Applications cannot register an uninstall handler to clean up after themselves as they are removed. An app may be able to provide its own uninstall procedure, but it would be up to the user to invoke it (which is unlikely to happen in reality).
I haven't found any tools or conventions for naming a folder so it will not conflict with any other apps. Since the file system is shared, developers need to be considerate of the file names they choose.

I also have no idea if the behavior of the simulator differs significantly from real devices regarding the file systems store and SDCard.



Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Please use plain text.
Developer
bneeman
Posts: 132
Registered: ‎02-11-2009
My Device: Not Specified

Re: Some questions about FileConnection/JSR 75


Ted_Hopp wrote:

I also have no idea if the behavior of the simulator differs significantly from real devices regarding the file systems store and SDCard.

 

The Simulator is faster when it comes to accessing data from the sd-card and store. That's about it. I've yet to see a build that works on the simulator and fails on the device. We also regularly exchange binary files between the microsd card of the device and the Simulator's "sdcard" directory. Fully compatible.

 

Cheers, Barak.

 

Please use plain text.