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
Highlighted
Developer
Posts: 138
Registered: ‎01-09-2011
My Device: Blackberry Tablet OS
Accepted Solution

Download Files to?

Are there limitations as to where my program can download files to? I know my program has restrictions as to where it can write to but is there a difference with downloading? I want to download files from a server into my application's directory.

From,
Noah NU
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Download Files to?

If there is not a limit now, I can imagine that they might have a limit in the future.  Hate to have one app knowingly or unknowingly fill up the disk space from files.  PB is not a laptop or desktop computer, so it does not have enless capacity.

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

Re: Download Files to?

Noah, you asked about "where", but accepted John's answer which addressed only size limits.

 

As far as size limits go, I don't think we'll see any.  Not any that a user can't override for your app, anyway.  Some users might want a single app to have full access to available disk space.

 

We'll probably have some sort of "install manager" tool that lets us view and remove installed apps, as well as checking data size for each.  Possibly a "clear temporary data" option as well, though the OS will do that automatically if it wants.  (That would wipe the contents of the local /tmp folder for apps, probably just those that aren't running or active.)

 

As for "where", you have a few options.

 

You can write to File.documentsDirectory, which points to the /shared/documents folder, or any sibling shared folder.  See the notes for 0.9.2 or my updated comments on 0.9.3 for more.

 

You can write to File.applicationStorageDirectory, even creating subdirectories there, but only your own app can see the files in that location.

 

You can write to what would currently be accessible as File.userDirectory.resolvePath('tmp'), and that will act somewhat like the applicationStorage directory except as mentioned earlier the data could be wiped out by the OS whenever it wants to free up space (though possibly not while your app is active... none of that has been documented for us).

 

As for downloading... there should be no differences with downloading or any other form of data storage, other than perhaps the default 5MB limit on the size of SharedObject data (which, again, hasn't really been documented for us).


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!