官术网_书友最值得收藏!

Using Flash Builder 4.5 to develop Android applications

Flash Builder 4.5 already comes equipped with everything, we need to begin developing mobile applications using either ActionScript or the mobile Flex Framework. For those unfamiliar with the differences between ActionScript and Flex, basically, the Flex framework provides a set of components, layouts, and data control that is preconfigured for building Flash applications, whereas when using ActionScript by itself, everything must be written from scratch. Flex 4.5 includes mobile features such as optimized component skins to run very well on devices, a new ViewNavigator application type, which is tailored to the mobile experience, and includes support for touch and gestures across the mobile-optimized component set.

How to do it…

In place of a normal ActionScript project or Flex project, we must specifically create either an ActionScript Mobile project or Flex Mobile project:

  1. In the Flash Builder Package Explorer, right-click on some empty space and choose New | Flex Mobile Project or New | ActionScript Mobile Project:
  2. We will then provide the mobile project with a name and choose where Flash Builder should store the project files on the local machine.
  3. The next step allows us to choose the target platform, in this case, Google Android, and define which application template to use (if you are making use of the mobile Flex framework). We can also set the default View name on this screen through the Initial view title input..
  4. Additionally, we will choose whether or not the application will reorient based upon device tilt with the Automatically reorient option. We can select to display the application at full screen by selecting the Full screen checkbox.
  5. One last selection to make on this screen is whether we would like to use density aware skins in our mobile components by selecting the Automatically scale application for different screen densities checkbox and selecting the appropriate Application DPI setting.
  6. The rest of the project setup is really the same as any other project in Flash Builder.

How it works…

The choices we make when setting up a new project in Flash Builder determine which libraries are imported, and used in an application. Defining a mobile application will not only include specific component skins targeted to mobile, but will also restrict us from using components, which are inappropriate for such use. We will also have full access to mobile-specific application structures such as the mobile ViewNavigator, ActionBar, or TabBar. These additions to the mobile Flex framework can be used to greatly speed up the development of stateful mobile Android applications, as they deal with application structure, navigation controls, and layout.

See also…

You can actually use previous versions of Flash Builder to compile AIR for Android applications. Check out the next recipe, Enabling Flash Builder 4 or Flex Builder to access Flex Mobile SDKs for an example of this.

主站蜘蛛池模板: 莱阳市| 黑龙江省| 桐城市| 新疆| 盈江县| 德安县| 崇礼县| 大城县| 米易县| 嘉善县| 城固县| 京山县| 宜黄县| 大城县| 宁陵县| 沿河| 五台县| 安丘市| 宝鸡市| 萨迦县| 胶南市| 志丹县| 固安县| 济宁市| 双流县| 宁德市| 文水县| 静宁县| 蓬安县| 武邑县| 庐江县| 兰溪市| 阿鲁科尔沁旗| 宁津县| 霍邱县| 安国市| 嵩明县| 崇明县| 罗甸县| 临城县| 北票市|