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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
Developer
shawnblais
Posts: 410
Registered: ‎10-25-2010

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/

Please use plain text.
BlackBerry Development Advisor
elena_laskavaia
Posts: 410
Registered: ‎10-27-2010

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)

Please use plain text.
Developer
shawnblais
Posts: 410
Registered: ‎10-25-2010

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

Please use plain text.
Developer
peter9477
Posts: 5,616
Registered: ‎12-08-2010
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 -- (PlayBook 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!
Please use plain text.
Developer
shawnblais
Posts: 410
Registered: ‎10-25-2010

Re: Application sandbox file system layout

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

Please use plain text.
New Developer
killerspaz
Posts: 199
Registered: ‎12-29-2010

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!?

Please use plain text.
Developer
zezke
Posts: 816
Registered: ‎12-12-2010
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.

-------------------------------------------
Your like is much appreciated!
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Please use plain text.
New Developer
killerspaz
Posts: 199
Registered: ‎12-29-2010

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!?

Please use plain text.
Developer
zezke
Posts: 816
Registered: ‎12-12-2010
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.

-------------------------------------------
Your like is much appreciated!
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Please use plain text.
Developer
peter9477
Posts: 5,616
Registered: ‎12-08-2010
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 -- (PlayBook 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!
Please use plain text.