I have been doing some tests on how can one port an ArcGIS Flex Web Application to a desktop AIR App. To my surprise it was quite simple, fast and, most of all, everything worked on the first run.
First of all I downloaded ArcGIS Viewer for Flex 3.1 source code, available on GitHub, and imported it to my Flash Builder workspace
Create a new Flex Project in File -> New -> Flex Project
Type a project name like ArcGISFlexDesktop and select Desktop (run in Adobe AIR)
Type a project name like ArcGISFlexDesktop and select Desktop (run in Adobe AIR)
For the next options go with the default.
Now that the project is created, expand folder src - (default package) and open the file ArcGISFlexDesktop.mxml. Also, on the FlexViewer Project, expand folder src - (default package) and open the file index.mxml
Now that the project is created, expand folder src - (default package) and open the file ArcGISFlexDesktop.mxml. Also, on the FlexViewer Project, expand folder src - (default package) and open the file index.mxml
As you can see from the above image, the desktop application entry point is the s:WindowedApplication. As for the web application it’s the s:Application. So the first action is to copy the contents inside the s:Application tag, properties included, and paste them inside the s:WindowedApplication.
Next, copy the selected files (see image below) from the FlexViewer project to the ArcGISFlexDesktop project. The project structure must be the same for both projects.
The next step is to add all the modules to the project. Go to Project - Properties and then in the ArcGISFlexDesktop Properties dialog select Flex Modules and add the following mandatory widgets.
- HeaderControllerWidget.mxml
- InfoPopupWidget.mxml
- WidgetContainerWidget.mxml
- OverviewMapWidget.mxml
- NavigationWidget.mxml
- MapSwitcherWidget.mxml
Finally you must copy the compiler arguments from the FlexViewer project to the ArcGISFlexDesktop project. Right click on the FlexViewer project and select Properties. Then go to the Flex Compiler tab and copy the text from the Addicional compiler arguments box. Paste this text into the same box on the ArcGISFlexDesktop project.
You’r all done! Press the run button and there you have it! An ArcGIS Flex AIR application.
The ArcGIS runtime is intended to work in online and offline modes. For the offline mode map tile packages are used, so the app needs to access the local file system. Flex RIA has the capabilities to access local file system so I have no clue on why there are no plans on making an ArcGIS Runtime based on Flex.
Download the installer of ArcGIS Flex Viewer for Desktop