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

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.

主站蜘蛛池模板: 武安市| 道孚县| 东乌珠穆沁旗| 沾益县| 绥阳县| 大安市| 永州市| 卓资县| 谢通门县| 东丽区| 平潭县| 江永县| 绥阳县| 崇礼县| 卓资县| 巴彦县| 明溪县| 柘城县| 定陶县| 宜州市| 剑阁县| 宁陕县| 弥渡县| 刚察县| 乌苏市| SHOW| 额敏县| 本溪| 麦盖提县| 舟曲县| 黄冈市| 郧西县| 寿阳县| 龙胜| 通城县| 北票市| 罗城| 云林县| 泸定县| 钦州市| 桐乡市|