air program auto update.

本文介绍了Adobe AIR应用如何实现自动更新功能。通过创建本地设置文件、在线指向文件及使用Adobe Labs提供的SDK,开发者可以轻松地为自己的AIR应用程序添加自动更新特性。

Air Application Auto-Update

July 30th, 2008

There is a SDK at Adobe Labs with a beta of Air Application Updates. There are 2 ways, using the UI update and the headerless update. The headerless allows you to make updates and checks without the end-user knowing the checks.

Lets make a small example.

Short Description:
1.) Local AIR Application read local config file.
2.) The config file points to external (online) config file.
3.) Online Config file holds online released update and path to file.
4.) If file is never, download and upgrade

air-updater

1.) Download the SDK
1.1) Download the files from Adobe Labs AIR Update Framework .
1.2) Put the 2 *.swc file into your app-folder/sdks/3.0.0/libs/air

2.) Create a Project
2.1) Well, you know how to create a Flex AIR Project =)

3.) The Local Settings File
3.1) Create an XML file in the project (mine is config.xml)
3.2) Change the url path where the online pointer file is.
3.3) If using the GUI version of update change the settings in defaultUI

<configuration xmlns="http://ns.adobe.com/air/framework/update/configuration/1.0">
	<url>http://www.undefined-type.com/update-buxfer.xml</url>
	<delay>1</delay>
	<defaultUI>
		<dialog name="checkForUpdate" visible="true" />
		<dialog name="downloadUpdate" visible="true" />
		<dialog name="downloadProgress" visible="true" />
		<dialog name="installUpdate" visible="true" />
		<dialog name="fileUpdate" visible="true" />
		<dialog name="unexpectedError" visible="true" />
	</defaultUI>
</configuration>

4.) Create the Online Pointer File
4.1) Create the XML file, (mines called update-buxfer.xml) this is so that I put all my pointer xml file at 1 place on my server.
4.2) Fill the file with example code.

<update xmlns="http://ns.adobe.com/air/framework/update/description/1.0">
  <version>1.4</version>
  <url>http://undefined-type.com/apps/buxfer_1.4.air</url>
  <description>
           <![CDATA[
               This update enables automatic updates in the future.
           ]]>
   </description>
</update>

5.) The actual file
5.1) Don’t forget to put the actual new *.air file on the server where you are pointing =)
5.2) When building make sure as well to change the “version” in the application xml file.

6.) The Code
6.1) When you want to check the update just add this code.

import
 air.update
.events
.UpdateEvent
;
import
 air.update
.ApplicationUpdaterUI
;
 
private
 var
 updater : ApplicationUpdaterUI;
private
 function
 check(
)
:void

{

	var
 confFile : File = File.applicationDirectory
.resolvePath
(
"config-template.xml"
)
;
	updater = new
 ApplicationUpdaterUI(
)
;
	updater.configurationFile
 = confFile;
	updater.addEventListener
(
UpdateEvent.INITIALIZED
, onInit)
;
	updater.initialize
(
)
;
}

 
private
 function
 onInit(
event:UpdateEvent)
:void

{

	updater.checkNow
(
)
;
}
Usage: VisualCppRedist_AIO_x86_x64.exe [switches] All switches are optional, case-sensitive. /y Passive mode, shows progress. *All* Runtime packages are installed. /ai Quiet mode, no output shown. *All* Runtime packages are installed. /aiA Quiet mode. *All* Runtime packages are installed, and hide ARP entries. /ai5 Quiet mode. *Only* 2005 package is installed. /ai8 Quiet mode. *Only* 2008 package is installed. /aiX Quiet mode. *Only* 2010 package is installed. /ai2 Quiet mode. *Only* 2012 package is installed. /ai3 Quiet mode. *Only* 2013 package is installed. /ai7 Quiet mode. *Only* 2022 package is installed. /ai9 Quiet mode. *Only* 2026 package is installed for Win 10/11. /aiT Quiet mode. *Only* VSTOR 2010 package is installed. /aiE Quiet mode. *Only* Extra VB/C package is installed. /aiB Quiet mode. *Only* Extra VB package is installed. /aiC Quiet mode. *Only* Extra VC package is installed. /aiV Quiet mode. *Only* VC++ packages are installed. /aiM Manual Install mode, shows installation script with prompt. /aiR Auto Uninstall mode, remove all detected runtimes. /aiD Debug mode, create VCpp_debug.log without installing/uninstalling any package. /aiP Manual Hide or Show Runtimes entries in Add/Remove Programs panel. /ai1 Update mode. Only already installed packages are updated. /aiF Repair mode. Only already installed packages are reinstalled or updated. /gm2 Optional switch to disable extraction dialog for all other switches. /sfxlang: Set the program display language, if possible. Example: /sfxlang:1031 /h | /? Display this help. 翻译成我能看懂的中文简体语言
11-06
【无人机】基于改进粒子群算法的无人机路径规划研究[和遗传算法、粒子群算法进行比较](Matlab代码实现)内容概要:本文围绕基于改进粒子群算法的无人机路径规划展开研究,重点探讨了在复杂环境中利用改进粒子群算法(PSO)实现无人机三维路径规划的方法,并将其与遗传算法(GA)、标准粒子群算法等传统优化算法进行对比分析。研究内容涵盖路径规划的多目标优化、避障策略、航路点约束以及算法收敛性和寻优能力的评估,所有实验均通过Matlab代码实现,提供了完整的仿真验证流程。文章还提到了多种智能优化算法在无人机路径规划中的应用比较,突出了改进PSO在收敛速度和全局寻优方面的优势。; 适合人群:具备一定Matlab编程基础和优化算法知识的研究生、科研人员及从事无人机路径规划、智能优化算法研究的相关技术人员。; 使用场景及目标:①用于无人机在复杂地形或动态环境下的三维路径规划仿真研究;②比较不同智能优化算法(如PSO、GA、蚁群算法、RRT等)在路径规划中的性能差异;③为多目标优化问题提供算法选型和改进思路。; 阅读建议:建议读者结合文中提供的Matlab代码进行实践操作,重点关注算法的参数设置、适应度函数设计及路径约束处理方式,同时可参考文中提到的多种算法对比思路,拓展到其他智能优化算法的研究与改进中。
### 关于 `Update.end()` 函数的用法 `Update.end()` 是 Arduino 中用于结束更新操作的一个重要函数,通常与 OTA(Over-the-Air)升级功能配合使用。它标志着一次固件更新过程的完成,并释放与此相关的资源。 当调用 `Update.write()` 或其他写入方法完成后,必须调用 `Update.end()` 来确认数据已成功传输并保存到闪存中[^4]。如果未正确调用此函数,则可能导致部分数据丢失或设备进入不可预测状态。 以下是其典型应用场景: #### 示例代码展示 ```cpp #include <WiFi.h> #include <HTTPClient.h> void setup() { WiFi.begin("SSID", "PASSWORD"); while (!Serial && !WiFi.isConnected()) delay(10); HTTPClient http; String url = "http://example.com/firmware.bin"; http.begin(url); int httpResponseCode = http.GET(); if (httpResponseCode == HTTP_CODE_OK) { const size_t bufferSize = 1024; uint8_t *buffer = new uint8_t[bufferSize]; int len; unsigned long fileSize = http.getSize(); WiFiUDP udp; while ((len = http.read(buffer, bufferSize)) > 0) { Update.write(buffer, len); } delete[] buffer; http.end(); if (Update.end()) { // 结束更新流程 Serial.println("OTA update successful."); } else { Serial.printf("Error Occurred. Error #: %d\n", Update.getError()); } } else { Serial.printf("Failed to fetch firmware. Response code: %d\n", httpResponseCode); } } void loop() {} ``` 上述代码片段展示了如何利用 `Update.end()` 完成从远程服务器获取新固件并通过串口打印结果的过程[^5]。 需要注意的是,在执行任何涉及硬件的操作之前,请确保已经配置好网络连接以及目标地址的有效性验证机制;另外还需注意内存分配策略以免造成不必要的性能瓶颈或者崩溃风险等问题发生。 --- ###
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值