O'Reilly logo

Flash Development for Android Cookbook by Joseph Labrecque

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Saving a file to device storage

There are a number of ways in which we can save data from an application to local device storage. Audio, images, and text data can all be created by the user and saved to either an application-defined location, or the user can be allowed to choose, which specific location to store the file upon within an Android device. In this example, we will demonstrate this through the generation of a simple text file.

How to do it...

We will allow the user to select the location and name of a basic text file that they will generate within our application and save to their Android device:

  1. First, we will need to import the following classes:
    import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required