introduction to air for android 邱彦林

14
AIR For Android AIR For Android 介介介 2010.11.28 +

Upload: flash

Post on 22-Apr-2015

2.427 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Introduction to air for android 邱彦林

AIR For AndroidAIR For Android 介绍介绍邱彦林 2010.11.28

+

Page 2: Introduction to air for android 邱彦林

• AIR 移动开发的优缺点

• 开发环境、调试,发布程序

• 新特性介绍

• Demo

• 交流

• 移动平台开发的一些特点

主要内容

Page 3: Introduction to air for android 邱彦林

优点:• 开发效率高• 快速移植到其它平台( PC , iOS , Black

Berry)

缺点:• 需要 Runtime 支持• 无法访问系统底层资源

AIR Android 移动开发的优缺点

Page 4: Introduction to air for android 邱彦林

开发环境

• Flash CS5 + AIR For Android 插件

• Flash Builder Burrito ( 测试版 ) ( 集成 Flex SDK Hero 和简单模拟器 )

• Flex SDK + AIR SDK 2.5( 不推荐使用 Flex SDK 3 、 4 等 UI 组件 )

Page 5: Introduction to air for android 邱彦林

• 安装 apk(Android Package) 文件:– 使用 adb 命令行– 在浏览器输入 URL 下载安装

• 使用 Android 虚拟机测试程序

• 发布到电子市场

apk 的安装、发布

Page 6: Introduction to air for android 邱彦林

• Accelerometer

AIR For Android 新特性

• CameraUI and CameraRoll

• 调用系统程序( Email,Tel,SMS,Browser) navigateToURL(new URLRequest('sms:1234567890'));

• StageWebView ( 替代 HtmlLoader )

• Geolocation

• StageOrientation

• Gesture and Touch

Page 7: Introduction to air for android 邱彦林

和 AIR 桌面端相比,不支持:• ServerSocket• HtmlLoader • NativeWindow, NativeProcess • LocalConnection • 详情列表见这里

和 Android SDK 相比,无法访问系统资源,比如:• 无法调用其它外部程序( Send Intent )• 无法访问名片夹、短信、电话记录…

不支持的功能

Page 8: Introduction to air for android 邱彦林

• 屏幕尺寸小,分辨率低, UI 需要自适应屏幕,可点击对象有足够的热区。

• 保存程序状态,因为程序随时可能被中断(比如对音频、视频的控制)

• 处理鼠标事件:拖拽、长按、手势、多点触摸

• 文本输入

• 性能优化,保持低能耗,能够长时间运行不影响正常使用。

AIR 移动开发要考虑的因素

Page 9: Introduction to air for android 邱彦林

一些问题的处理方法

• 多屏式结构中,保持尽可能少的显示对象

• 使用 Event.ACTIVE 和 Event.Deactive 处理程序状态的改变

• 处理 Back 和 Menu 键

• 数据的列表显示、分页

Page 10: Introduction to air for android 邱彦林

Menu

Back

Page 11: Introduction to air for android 邱彦林

SplashScreen 启动画面

First View 初始界面

Second View

Third View …

ViewNavigator 管理所有的 View 对象

MobileApplication 处理全局事件,包括侦听 Resize 、键盘事件( Back) 、 Active 和 Deactive 等全局事件

每个页面都派生自 View类,实现各自的事件处理

Flex SDK Hero 的 Mobile 程序结构

Page 12: Introduction to air for android 邱彦林

Demo

在游戏中使用 Accelerometer 一个简单的小游戏,演示如何使用加速度感应

新浪微薄客户端 QuichSharePhoto使用新浪微薄的 API创建的小程序,将拍摄的照片直接发布到自己的微薄上。要点:调用摄像头

Page 13: Introduction to air for android 邱彦林

links

Flex SDK Hero 示例程序http://labs.adobe.com/technologies/flexsdk_hero/samples/

优化 ADOBE® FLASH® 平台的性能 http://help.adobe.com/zh_CN/as3/mobile/index.html

Page 14: Introduction to air for android 邱彦林

谢谢!