Building Mobile Applications With FDT
From FDT Documentation
With FDT5, a new mobile workflow has been introduced. This tutorial will give an overview of what it's like to create mobile applications with FDT.
Creating A Mobile Project
Begin by right clicking within the editor and selecting 'New FDT Project'.
The new project wizard will open. Once open choose a new mobile project.
- Enter the project name here.
- Choose the type of project from the templates. In this case we're using a mobile AS3 project
- Here are options for the mobile AS3 project.
Launching and Debugging A Mobile Project
*note: FDT 5, by default, does not add the Android permission for debugging. You can add it your self via the mobile permissions page. See this FAQ for more info.
Launching a mobile project is not very different from launching a web project.
After writing your desired code, simply right click within the editor of the class you wish to be your 'Main' class and choose Run As (or Debug As) FDT Mobile Application.
If this is the first time this project has been launched, FDT will automatically open the Mobile Launcher for you. Here you have several options.
- Here is the currently selected launcher.
- The current launch platform will exist here. The options are iOS and Android.
- The two launch methods are 'On desktop' and 'On device'. If launching on desktop you can choose to use a mobile present resolution or set your own.
- To make additional changes, or to setup a particular platform, click this link to jump to the Mobile Project properties view.
When FDT has compiled the application, FDT will open the ADL and show it.
Debugging is just like launching, the only difference is that instead of choosing 'Run As' or the 'Run' menu, "Debug As' or the debug button is chosen.
Debugging & Launching On Device
If you have an Android device connected, and the appropriate drivers installed, FDT will package and deploy the application to your device.
- In the above example, the 'On device' option has been selected for Android.
If iOS is selected, the GUI will change to show iOS packaging options.
iOS & Android Differences
When testing your Android application on your device, you won't need any special setup. If your device is connected, set to debug mode and your drivers are installed (Win only) you are good to go. You don't even need a valid .p12 file, FDT will generate a temporary one for you.
If you want to test your application on your iOS device, you'll need to make sure that you have a valid .p12 and provision file. Read more about it here.
To test an iOS application on a device, you'll need to manually install onto your device.
To access the mobile properties for you project, simple right click on the project and select 'Properties'.
Once inside the project properties, navigate to FDT Mobile Properties>Android. Here you'll first see the Building tab.
The Building tab is where you set the .SWF and descriptor file you wish to work with.
- The Enable checkbox will show the platform options.
- The Application descriptor associated with this platform will appear here.
- Changing the name of the .SWF.
- If you wish to change descriptor files, use the Browse button.
- Create a new descriptor file. This will use the descriptor file from the currently selected SDK.
The properties tab will differ slightly depending on the platform you wish to use. In general, this is a GUI to edit the descriptor.xml file that is set in the Building tab.
Learn more about using descriptor files here
- These input fields help manage your application information on the deployed on device.
- This area will dynamically change depending on the selected platform. In this example, you edit Android OS permissions here.
Similar to the Properties tab, this tab will be slightly different for Android and iOS. If set, FDT will use this certificate for testing (building via launcher) and for deployment. If it is left blank, FDT will generate a dummy one itself; however, it MUST be set when about to deploy to a Market place.
- The selected certificate and password are shown here.
- If you have an existing certificate you'd like to use, select it here.
- Create your certificate here.
- When testing iOS applications on a device, you'll need a valid provision file and key. Learn more about the process here.
- If desired, you can have two separate keys setup. This is handy when you have one provision file for personal use, but you use a separate one for larger distribution.
Set your application icons here. When your icons have been set, make sure that the icons are included within your Package Contents.
- Resolution for icons that are required for the selected platform.
- Choose a valid .png file.
- Remove the path to an icon.
- The description.xml & .SWF are needed and cannot be removed.
- Here the paths for the icon files set in the Icons tab are set .
- Optionally you can choose to include an entire directory (e.g. your entire icon directory).
If your project uses Native Extensions feature of the Air 3.0 SDK, the extensions can be set here.
When you're ready to deploy your application for distribution (or for iOS Ad Hoc) you export it here. This is generally done at the end of your development process when you want all debugging information removed. This will mean a slightly longer compilation process and in the case of iOS, this could be several minutes.
- To ensure that a non-debug version of your .SWF is generated, you must choose which launcher to execute just ahead of finial packaging.
- Where your finial file (.apk or .ipa) is saved to.
- For Android, you may choose a store setting where the AIR runtime can be acquired in case your customers don't have AIR installed.
- Choose this to have the finial application installed on your device.
- Begin the finial packaging process.
- Either compile for the App store or for a limited distribution (e.g. testing).