Packaging External Resources

If your application has a lot of art, you may want to keep the art external to the application and load it at runtime. In the AIR for Android settings, if you are using Flash Professional, add the resources to the “Included files” list at the bottom of the General tab.

In Flash Builder, create a directory called assets in the scr folder, and place your art in it. Right-click on your project and select Properties. Then select ActionScript Build Packaging→Google Android→Package Contents and select the assets folder if it is not already selected.

If you are using the command line, list the files or the containing folders at the end of the command line:

AIR-sdk-path/bin/adt -package -target apk -storetype pkcs12 -keystore yourCertificate.p12 hello.apk Main-app.xml Main.swf image.jpg movie.flv data.xml

Another way to handle external files is to store them on the SD card and access them via File Access. You cannot remove files included at the time of installation because it would make the application invalid. You can, however, copy them to the SD card. This is the approach you would use if you want to modify them during the life of the application.

 


Posted

in

by

Tags: