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

Posts: 194
Registered: ‎11-12-2010
My Device: Not Specified
Accepted Solution

How to create updates vs.complete new version of app?

Could somebody explain or point me to a resource where I can learn about structuring my code with future updates in mind?


More specifically, my app (not yet submitted) includes a piece of music and some graphics that are compiled into the app by placing them in a folder under the src folder (in FlashBuilder). Those required assets bump the size of the bar file up from something like 500k to 3MB, so I'm thinking there must be a way to tell the app to save that stuff somewhere on the user's device, so that next time I want to release additional features, I can just compile the new code and users can download a smaller file that will know where to find the previously installed music and graphics ...


I'm using SharedObject for saving user preferences, but I don't think that's the right place for actual files.


I'm also not sure how the general logistics would work - would I basically submit two bar files to AppWorld, one stand-alone version to be used for new customers and one code-only (or even changed-classes-only ???)  version for existing customers?




Posts: 274
Registered: ‎11-01-2010
My Device: PlayBook?
My Carrier: WiFi

Re: How to create updates vs.complete new version of app?

You probably want to save to documents directory: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html


To my knowledge there's no way of doing as you propose with multiple BARs. However what you could do is have the SharedObject check for a Boolean flag (installed) - if it doesn't exist, set it and download your assets from your website.


But honestly... in the case you're talking about, 500K to 3MB, this is all pointless and will just be a hassle to maintain. I would only ever bother with this if you're app was reaching the hundreds of MB. An extra 2.5 MB is nothing. If you're really concerned about size, make sure that you're using compressed images - that alone should drop the size down significantly.

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

Re: How to create updates vs.complete new version of app?

There's no support for something like that, and I think it's unlikely to exist any time soon.

It's also a compatibility nightmare, since you may have users who have not updated from earlier versions of your app.

In principle, you'd need to cover each possible upgrade path, which would get to be far more trouble than it's worth. Especially when you're talking about only a megabyte or two.

Vendors with apps containing hundreds of megabytes of data could structure things differently, having the app download those assets from the net the first time they run. Then updates could also be small.

For now, just treat it as all bundled code and data get replaced, and the modifiable data (e.g. that SharedObject) stay put during an update.

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!
Posts: 194
Registered: ‎11-12-2010
My Device: Not Specified

Re: How to create updates vs.complete new version of app?

Ah, thank you both for the excellent information (yes, I thought 3Mb might not be worth fretting about  - but I always like to learn the professional way of handling things (not having much of a computer science background, I guess I'm always worried about my 'home-cooked' code giving away my lack of experience  :-))


Anyway, Peter's point about supporting multiple update paths, of course makes total sense!  Good to know the 'download-from-elsewhere' solution outlined by RottenOgre, in case I ever write an app with something huge.