01-13-2011 02:53 PM
If userDirectory is in the shared documents folder then that works well, we can use the same convention used on android:
/userDirecory/appName/
01-13-2011 03:00 PM
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)
01-14-2011 09:40 AM
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...
01-14-2011 10:05 AM
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.
01-14-2011 11:22 PM
Ha. nice, sorry I'm so used to Android development where that string is completely useless. Thanks!
02-02-2011 01:35 PM
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!?
02-02-2011 01:46 PM
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.
02-02-2011 01:48 PM
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!?
02-02-2011 01:52 PM
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.
02-02-2011 01:58 PM
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.