Adobe-Runtime-Support
Adobe-Runtime-Support copied to clipboard
App loading is delayed when multiple swf files added in the app bundle
I have added 20 levels using swf files in my android app but the app is taking 60 seconds to open. Total size of the apk is 86 MB. Kindly give suggestions to speed up App loading. I am using WebP ANE extension to reduce the file size and I am using the latest Air SDK. Is there any other way to load multiple swf files within the app? Kindly give suggestions.
How are you loading these multiple SWF files in your app? Do you have one main SWF for your app, and then loading in extra content at runtime from other external SWFs using a Loader? And is it taking 60 seconds just to load your initial content SWF, or 60 seconds including loading all of the additional SWFs? Some more info on how you've structured things may be helpful to give any feedback.
I don't often use multiple SWFs, but in general I'd recommend adding a brief delay in the main SWF before trying to load external content (in case you're trying to start up a Loader immediately upon launch), since trying to do too much immediately can affect the speed of launching an app on Android. I would also likely wait until one external SWF is loaded before loading the next, rather than loading multiples all at once.
And depending on the compiler you're using, you may be able to add a preloader that will speed up the application launch -- I think this is only with the older mxmlc compiler and not with the newer ASC 2.0 compiler (it was being added at one point, but not sure if that was fully completed -- maybe it works with that now too though?)
Taking 60 seconds for the app to open. Is it possible to load the SWF files from the server and if so how to load it? Could you provide the code for it? Give guidance for loading multiple SWF files from the server within an app.
@ajwfrost
@Odd1Apps see #3076 which has some sample code. It can probably be fleshed out with progress events if you wanted to display some download progress bar or similar...
If this is for an app then you probably don't want to do this every time, so I'd suggest having a location under File.applicationStorageDirectory that you use for these files; if they don't exist then download them from the server via URLStream(), but then just use the Loader from that local storage location (you should be able to use a URL such as "app-storage:/local_swfs/download1.swf").
thanks