Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I improve loading speed / publishing speed for an AIR for Android App with many classes?

I have the following scenario:

An app for Android devices that has a few hundred classes. I am using Flash CS5.5, developing in AS3 using AIR for Android.

The app is a puzzle game and each class represents one of the elements from the puzzle. Each class is a derivative of a base class and only holds a few specific information like unique name, category, place in puzzle. Each class also has attached an 80 x 80 px image to it. However, there's about 300 classes like this.

The application runs very smoothly ONCE IT LOADS because it takes forever for the application to publish and then for it to run on the mobile device. I have no issue with the exporting/publishing time being high and the installation time on the mobile device being quite high. But each time I run the application from the mobile device, it takes some 2 minutes for it to load which is abnormally high, not even high-end 3d FPS games load for that long. Tests are done on a HTC Sensation running Android 4.0 and, subsequently 4.1.

My question is, what can I do to help reduce this initial startup time? I mention again, the app runs smoothly once loaded since it is really not that complex nor does it use a lot of graphics aside the many 80x80 JPG images attached to each class. In early testing, when I had like 20-30 classes only implemented, everything was smooth. When I added all the elements needed for the game after the game's logic was complete, everything was slow to load.

Thank you for any answers/suggestions.

like image 367
Ioan Avatar asked Nov 12 '22 17:11

Ioan


1 Answers

If you want to speed up compile times for an AS3 project in Flash CS5.5, go into the Actionscript 3 settings for your .fla and turn off 'Warnings mode'. Warnings mode has a bit of overhead because it tries to give you helpful warnings when migrating code from AS2 to AS3. If you know what you're doing, you can turn this off and save lots of time.

1) File > Publish Settings. 2) Click the wrench icon next to 'Actionscript 3.0' 3) Uncheck 'Warnings Mode'

This cut doing compile times on a big project for me quite a bit. Another thing that helps is to divide up your assets into smaller swfs/swcs that are just brought in during runtime.

Only a partial answer, I'm not sure how to fix up a slow load time on an Android device. Good luck!

like image 101
robochase6000 Avatar answered Nov 15 '22 07:11

robochase6000