Adobe AIR 2 本机 API/代码
使用 Adobe AIR 2 Native API/Code 会使应用程序平台特定吗?如果是的话,在这种情况下使用 AIR 有什么用处,以便我可以使用现有的 Web 技术拥有前端?
will using Adobe AIR 2 Native API/Code make the app platform specific? if so what might be the use of using AIR in such a case, so that i can have a front end using existing web technologies?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,在 AIR 应用程序中使用本机代码将使其特定于平台 - 不仅如此,AIR 2 还有另一个新功能可让您生成本机安装程序(即 MyApp.exe 而不是 MyApp.air),以及新的本机仅当您使用本机安装程序时,流程 API 才可用,因此应用程序安装程序本身也是特定于平台的。
用例基本上是,AIR 最初阻止对本机进程的访问,以保证应用程序可以跨平台运行,但很多人希望找到一种方法来解决这个问题。因此,他们添加了一种制作特定于平台的应用程序的方法,但前提是您有意使用特定于平台的有效负载。
至于好处,您放弃了在所有平台上使用一个安装程序的能力,但您保留了使 AIR 对您有价值的其他任何东西 - 能够使用现有的 Web 内容,能够使用 Web 技术而不是 C/ 进行开发.net/等。当然,您仍然可以获得跨平台的大部分好处,因为您的应用程序的大部分仍然只需要开发一次(假设它的特定于平台的部分与其他部分相比很小)。
Yep, using native code in an AIR app will make it platform-specific - not only that, but AIR 2 also has another new feature to let you generate native installers (i.e. MyApp.exe instead of MyApp.air), and the new native process APIs are only available if you used a native installer, so the app installer itself is also platform-specific.
The use case is basically that AIR originally blocked access to native processes in order to guarantee that apps would work cross-platform, but lots of people wanted a way to get around this. So they added a way to make platform-specific apps, but only if you purposely use a platform-specific payload.
As for the benefit, you give up the ability to use one installer on all platforms, but you keep anything else that was making AIR valuable to you - being able to use existing web content, being able to develop with web technology instead of C/.net/etc. And of course you still get most of the benefit of being cross-platform, in that most of your app still only needs to be developed once (assuming that the platform-specific part of it is small compared to the rest).