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

Adobe AIR Development

Reply
Developer
Posts: 439
Registered: ‎10-25-2010
My Device: Not Specified

Re: Application sandbox file system layout

If userDirectory is in the shared documents folder then that works well, we can use the same convention used on android:

 

/userDirecory/appName/

BlackBerry Development Advisor
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: Application sandbox file system layout

If this is application specific files don't write them to shared folder, but to application storage folder.

If they are shared write them by type not by application name (types are directory names - listed above, plus "photos" which I missed apparently)

Developer
Posts: 439
Registered: ‎10-25-2010
My Device: Not Specified

Re: Application sandbox file system layout

The reason I save to the shared folder on Android is to avoid wasting the internal memory of the device.

 

My app caches mp3 files as it plays them, it can easily consume nGB of data, so for Android this needs to live on the SD Card, which is File.userDirectory.

 

Is this a non issue on playbook? IE, everything resides on flash memory anyways so it doesn't matter?

 

If so, is there a hook I can add to my code to tell if I'm specifically on a Playbook? I'm not going to be changing this back and forth each time I package...

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Application sandbox file system layout

Currently flash.system.Capabilities.os returns "QNX 6.6.0 PlayBook Simulator".

 

I would imagine checking that string for "QNX" would, for now, be an adequate way to say "I'm on the PlayBook".

 

There's also qnx.system.Device, but obviously you can't use that in a system-agnostic app.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 439
Registered: ‎10-25-2010
My Device: Not Specified

Re: Application sandbox file system layout

Ha. nice, sorry I'm so used to Android development where that string is completely useless. Thanks!

New Developer
Posts: 199
Registered: ‎12-29-2010
My Device: Not Specified

Re: Application sandbox file system layout

How is File.documentsDirectory or File.userDirectory accessible from other apps?

 

There's (appname)/folderName in the table, so we'd have to know the full path to the app, wouldn't we?

 

Yet it's been stated we can't depend on the filename of a folder because a hash is appended to the end of it.

 

 

 

I'm in need of generating output for the user to then later attatch to an email, or review, etc.

Where would I put that??

 

Also, one guy mentioned one app generates files for another app to use as backdrops... how ar eyou managing that!?

Developer
Posts: 1,008
Registered: ‎12-12-2010
My Device: Passport (Red Limited Edition)
My Carrier: Mobile Vikings

Re: Application sandbox file system layout

Just put you generated content in the documentDirectory. Other apps can then browse this location for certain file types. I don't know if this is correctly working in the current SDK, but that's how they told us it would be.

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
New Developer
Posts: 199
Registered: ‎12-29-2010
My Device: Not Specified

Re: Application sandbox file system layout

I could see that if they changed the location path, but one guy said he had it working that way... maybe he meant for another platform!?

Developer
Posts: 1,008
Registered: ‎12-12-2010
My Device: Passport (Red Limited Edition)
My Carrier: Mobile Vikings

Re: Application sandbox file system layout

If you save an image to the documentsDirectory, the File.browseForOpen method should be able to display and select your generated image in another app. Other filetypes won't work for now due to bugs in the browse methods when using FileFilters.

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Application sandbox file system layout

 


killerspaz wrote:

How is File.documentsDirectory or File.userDirectory accessible from other apps?

 

There's (appname)/folderName in the table, so we'd have to know the full path to the app, wouldn't we?


What you're missing from that picture is the concept of symbolic links (aka "soft links")... the shared folder is actually soft-linked from within the app's own folder to the real shared folder, which is in a different location.

 

That means each app can get to the shared folder without, technically, knowing what absolute path in the filesystem it is really at.  Even if you did know, you wouldn't want to hardcode that into anything.

 

 


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!