Flex - 在后台运行空气应用程序
我试图为我的用户提供一个选项,让我的应用程序自动启动并在每周的特定时间完成任务。
我可以使用 NativeApplication.nativeApplication.startAtLogin=true 让我的应用程序在登录时启动,但然后我想检测时间是否是他们选择的时间,如果不是,则在后台运行应用程序,直到时间匹配或用户关闭计算机。
有谁知道有什么方法可以做到这一点?在 Adobe 比较 Flex Web 应用程序和桌面应用程序的网页上,它向我暗示应用程序可以在后台运行,但我很难找到任何东西。
I am trying to provide my users with the option to have my application launch automatically and complete a task at a certain time every week.
I can make my application launch at log in using NativeApplication.nativeApplication.startAtLogin=true but I then want to detect if the time is the time they selected and if it isn't then run the application in the background until the time does match or the user shuts down their computer.
Does anyone know of a way to do this? On Adobe's webpage comparing Flex web apps and desktop apps it implied to me that applications could be run in the background but I'm struggling to find anything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以关闭初始本机窗口而不终止进程
,或者
您可以关闭初始本机窗口并创建一个充当桌面小部件的新窗口,而不会以 UTILITY 或 LIGHTWEIGHT 窗口类型出现在任务栏中。
http://help.adobe.com/en_US /air/reference/html/flash/display/NativeWindowInitOptions.html#type
You can close the initial native window without killing the process
OR
You can close the initial native window and create a new window that acts as a desktop widget without appearing in the taskbar with either the UTILITY or LIGHTWEIGHT window type.
http://help.adobe.com/en_US/air/reference/html/flash/display/NativeWindowInitOptions.html#type
您可以在下一个“作业”应该运行的时间保持进程运行,或者您可以设置特定于操作系统的系统 cron 作业(或类似的东西)。您需要使用 NativeWindow 选项 ' LIGHTWEIGHT' 以便您的应用程序不会向用户显示。
就我个人而言,对于这些类型的过程,我什至不尝试使用 Air,因为它并不是真正为这类东西而设计的。它旨在用于基于 UI 的应用程序,而不是基于流程的应用程序。请改用 Java 或 C#。
Either you keep the process running which times when the next 'job' should be ran, or you can set a system cron job (or something similar) which is specific to the OS. You'll want to use the NativeWindow option of 'LIGHTWEIGHT' so that your application doesn't show up to the user.
Personally, for these kinds of processes, I don't even try to use Air since it isn't really made for this kind of stuff. It's meant to be used for UI based apps and not process based. Use Java or C# instead.