- 浏览: 122417 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
yanmie:
您的文章已被本站收录地址:http://www.airmyth ...
开源媒体框架(OSMF)的介绍和概况:下 [译] -
wjc_andy:
大神 能把源文件发来看看么
从网页安装和运行AIR 应用程序系列(系列二) -
tanni:
注意:现在XML需用2.5,且XML的版本号要与APP.XML ...
AIR 自动更新详解 -
cvpc:
先谢过,试试好不好使
AIR 自动更新详解 -
fins:
引用
今年将推出 AIR 2.0 桌面版, AIR IPhon ...
Adobe AIR Openscreen 启航
AIR 1.5 加入了自动升级的类air.update.ApplicationUpdater,这样你的AIR应用程序便可以通过网络自动更新到最新版本了。
注意:Flex SDK 3.2以上才支持AIR 1.5,Flex SDK 4.0运行可能会有报错。建议采用Flex SDK3.4。
自动更新的原理:ApplicationUpdater 会去读取网络上的一个XML版本描述文件,其中包含了版本号和对应的安装文件路径以及更新描述信息,然后和当前运行的AIR程序版本进行比较,来决定是否下载和安装。
这里有一个例子:
<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="checkForUpdate()"> <mx:Script> <![CDATA[ import mx.controls.Alert; import air.update.events.UpdateEvent; import air.update.ApplicationUpdaterUI; private var appUpdater:ApplicationUpdaterUI = new ApplicationUpdaterUI(); private function checkForUpdate():void { appUpdater.updateURL = "http://localhost:8400/team/xml/test-update.xml"; // Server-side XML file describing update appUpdater.isCheckForUpdateVisible = false; // We won't ask permission to check for an update appUpdater.addEventListener(UpdateEvent.INITIALIZED, onUpdate); // Once initialized, run onUpdate appUpdater.addEventListener(ErrorEvent.ERROR, onError); // If something goes wrong, run onError appUpdater.initialize(); // Initialize the update framework } private function onError(event:ErrorEvent):void { Alert.show(event.toString()); } private function onUpdate(event:UpdateEvent):void { appUpdater.checkNow(); // Go check for an update now } ]]> </mx:Script> </mx:WindowedApplication>
creationComplete=”checkForUpdate()”表示在程序加载完成后会连接到更新服务器上自动监测新版本。
服务器上的XML文件(test-update.xml)内容如下:
<?xml version="1.0" encoding="utf-8"?> <update xmlns="http://ns.adobe.com/air/framework/update/description/1.0"> <version>v1.1</version> <url>http://localhost:8400/team/update/test.air</url> <description>update</description> </update>
注意:XML中的版本号和指定的AIR程序的版本号一定要保证匹配。
请使用发行版本来测试,调试版本不支持升级安装。
当然,你可以可以采用第三方类包来简化开发流程:
下载everythingflex的类包: everythingflexairlib.swc 把类包copy到你工程的libs文件夹。
地址:http://everythingflexairlib.googlecode.com/files/everythingflexairlib.swc
这里有一个例子:
<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ import com.everythingflex.air.managers.UpdateManager; private var updateManager:UpdateManager = new UpdateManager("http://localhost:8400/team/test-update.xml",false); ]]> </mx:Script> <mx:Button click="updateManager.checkForUpdate()" label="Test for Update" horizontalCenter="0" verticalCenter="0"/> </mx:WindowedApplication>
其中UpdateManager构造函数第2个参数代表是否自动检测新版本,TRUE为是,FALSE为否。
<?xml version="1.0" encoding="utf-8"?> <currentVersion version="v1.1" downloadLocation="http://localhost:8400/team/update/test.air" forceUpdate="false" message="Added new features" />
同上,你还需要一个放在服务器上的XML文件,告知程序要更新到哪一个版本:
其中:downloadLocation是更新程序的路径,forceUpdate表示是否弹出警告框来提示用户更新程序,message是警告框中的详细信息。
开发过程可能遇到的错误代码列表:
16800 Occurs during validating the downloaded update file. The subErrorID may contain additional information.
16801 Invalid Adobe AIR file (missing application.xml).
16802 Invalid Adobe AIR file (missing mimetype).
16807 Invalid Adobe AIR file (format).
16804 Invalid Adobe AIR file(invalid flags).
16805 Invalid Adobe AIR file(unknown compression).
16806 Invalid Adobe AIR file (invalid filename).
16807 Invalid Adobe AIR file (corrupt).
16808 Configuration file does not exist.
16809 updateURL not set.
16810 Reserved.
16811 Invalid configuration file(unknown configuration version).
16812 Invalid configuration file (URL missing).
16813 Invalid configuration file (delay format).
16814 Invalid configuration file (invalid defaultUI values).
16815 Invalid update descriptor (unknown descriptor version).
16816 Invalid update descriptor (missing update version).
16817 Invalid update descriptor (invalid description).
16818 IO error while saving data to disk. subErrorID may provide more information.
16819 Security error while downloading. subErrorID may provide more information.
16820 Invalid HTTP status code. subErrorID may contain the invalid status code.
16821 Reserved.
16822 IO error while downloading. subErrorID may provide more information.
16823 EOF error while saving data to disk. subErrorID may provide more information.
16824 Invalid update descriptor. subErrorID may provide more information.
16825 The update file contains an application with a different application ID.
16826 The update file does not contain a newer version of the application.
16827 The version contained in the update file does not match the version from the update descriptor.
16828 Cannot update application, usually because the application is running in the AIR Debug Launcher (ADL).
16829 Missing update file at install time.
--虾米
评论
<?xml version="1.0" encoding="utf-8"?>
<update xmlns="http://ns.adobe.com/air/framework/update/description/2.5">
<versionNumber>2.0.1</versionNumber>
<url>http://localhost:8080/TestMobileDriveWeb/AirTest2.air</url>
<description>This is the latest version of the Sample application.</description>
</update>
发表评论
-
关于AIR应用中共享HTTP Cookies的更多信息 [译]
2011-01-24 13:03 2334原文:More on Sharing HTTP Co ... -
已发布的AIR下载链接列表
2011-01-24 12:56 1985嗨,如果你还在为能下载到已发布过AIR Runtime 老版本 ... -
EncryptedLocalStore在移动设备或TV上的替代方案 [译]
2011-01-22 17:45 1709原文:Replacing EncryptedLocalS ... -
移动设备上的NativeWindow [译]
2011-01-20 18:42 1477原文:Replacing NativeWindow on Mo ... -
移动设备上的AIR程序是如何更新的 [译]
2011-01-20 18:39 2089原文:Replacing Updater on mobile ... -
Adobe AIR for Android 中的GPU 渲染 [译]
2011-01-17 20:14 3736原文:GPU Rendering in Adobe AIR f ... -
Flex/Flash整合HTML API [译]
2011-01-17 17:40 2101原文:Integrating Flex/Flash with ... -
在Linux平台下AIR对证书认证的支持 [译]
2010-12-05 12:36 1512原文:Certificate Support in AIR f ... -
AIR的企业分发 (三) [译]
2010-12-05 11:39 1797使用IBM Trivoli Provisioning Mana ... -
显示已安装的AIR应用程序的调试错误信息 [译]
2010-11-29 19:45 1528原文: http://cookbooks.adobe.com/ ... -
AIR的企业分发 (二) [译]
2010-11-27 19:17 1493使用Microsoft SCCM 2007 该节阐述了 ... -
AIR的企业分发 (一) [译]
2010-11-27 19:06 1668原文:Distributing AIR in the en ... -
Adobe AIR 2.5 中的HTML, HTML5, CSS 和JavaScript 新特性 [译] 下
2010-11-12 11:47 3128Adobe AIR 2.5 中的HTML, HTML5, ... -
Adobe AIR 2.5 中的HTML, HTML5, CSS 和JavaScript 新特性 [译] 上
2010-11-12 11:39 1859Adobe AIR 2.5 中的HTML, HTML5, CS ... -
PFI (Packager for iPhone) 更新 [译]
2010-10-13 23:18 1238原文:Packager for iPhone update ... -
开源媒体框架(OSMF)的介绍和概况:下 [译]
2010-09-15 12:45 3652OSMF考虑到媒体引入了新的类和新的概念 对于有Action ... -
开源媒体框架(OSMF)的介绍和概况:上 [译]
2010-09-15 11:20 6024原文:http://www.adobe.com/devnet/ ... -
AIR应用程序中TLS客户端身份验证的使用 [译]
2010-09-10 19:02 1554原文:http://blogs.adobe.com ... -
设置AIR应用程序的MIME类型 [译]
2010-09-10 17:54 3316原文:http://www.davidtucker.net/2 ... -
针对本地应用程序安装器(Native Application Installer)的一个更新框架 [译]
2010-08-26 18:36 1345原文:An Updater Framework for Nat ...
相关推荐
主要是用于flex AIR工程远程自动检测新版本更新功能。 主要对比是<version>v4中version的版本,如v4
版本Flex4.6 Air3.1,项目下载下来就可以用。项目打包安装后,可以同时开多窗,也可以自动更新。本来有效果图的,但是传不上来
NetBackup AIR 自动映像复制操作手册,详细的操作步骤及截图。
Adobe flash3 AIR 更新 中文 Adobe flash3 AIR 更新 中文
AIR、ANE与Android开发详例,从头到尾的介绍
X98-Air Ⅱ-自动刷WIN8 bios工具
AirPrint无线打印技术当前仅面向Mac开放,并且只能在几款惠普打印机上实现。没有这些AirPrint兼容打印机的可以借助一款名为Printopia的Mac程序激活AirPrint功能,那么Windows用户呢?想在PC上启用AirPrint的Windows...
iPad能自动在你的WLAN网络中找到支持AirPrint的打印机,并与其相连。无论你是在房间的另一端,或是建筑的另一边,都可以在需要的时候进行打印。整个过程极为简便、快速,在你读完这句话的片刻,这一页就从iPad打印...
如果你有台iPhone手机, 或者苹果iPad平板电脑,那么你可以很方便得利用苹果iOS系统内置AirPrint功能WiFi无线打印照片,Word,PDF等各种文件到你的Air Printer打印机,但有个前提是你的打印机必须支持苹果Air Print...
NetBackup 8.1.1 AIR测试 netbackup air 自动映像复制操作手册,详细的操作步骤及截图.
对于苹果用户来说,AirPlay一定是一项令人印象深刻的技术,可以实现苹果不同设备间的内容投放,例如,iPhone、iPad中的内容可以通过AirPlay在Mac的屏幕上投放出来,不仅可以增强个人的视觉体验,还十分有利于群体间...
微博air是基于新浪微博的air客户端,需要adobe air平台支持,支持在Windows、MAC、Linux下运行,可让微博支持即时聊天,好友上线提醒,沟通更快捷;丰富的个性功能,追求最佳用户体验。 安装方法: 第一步:...
MAC air 安装win7系统自动加载 USB3.0驱动
adobe air 连接 airplay功能
解决2012年Air装Windows黑屏补丁
全AIR 的 Socket通信,air服务端、air客户端,没有用到其他后台语言
flashair电脑版是在电脑上使用flashair存储卡必装的一款软件,这款软件可以让用户对flashair卡进行设置、软件更新、初始化。flashair电脑版可通过无线LAN在电脑网络驱动器上查看FlashAir里的文件。可以选择数个照片...
专题资料(2021-2022年)AIR3兼容HTML5及AIR程序更新与调用本地类库方案的评估报告.docx
附件是最近很畅销的airplay传输器airmusic的使用说明
AIR教程 1 Adobe AIR右键菜单和系统托盘(Tray)功能以及实现方法 2 如何将应用程序最小化到托盘,然后给托盘图标加右键菜单以及添加相应的事件,来激活应用程序窗体