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.
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; import flash.events.Event; import flash.events.TouchEvent; import flash.filesystem.File; import flash.text.TextField; import flash.text.TextFormat; import flash.ui.Multitouch; import flash.ui.MultitouchInputMode;
2. We will need to declare...