简体   繁体   English

跨平台桌面开发

[英]Cross-platform desktop development

I need an advice for cross-platform engine/framework for desktop PC application development (Windows, MAC, Linux). 我需要为桌面PC应用程序开发(Windows,MAC,Linux)提供跨平台引擎/框架的建议。 I see 3 possibilities, Qt, Java and Adobe AIR. 我看到了3种可能性,Qt,Java和Adobe AIR。

  • It must be easy to install (run-time is a drawback, but C++ wrapper and/or installer can solve the issue I think). 它必须易于安装(运行时是一个缺点,但C ++包装器和/或安装程序可以解决我认为的问题)。
  • It must be fast and have a rich GUI (not 3D game, but definitely some 2D graphics). 它必须快速且具有丰富的GUI(不是3D游戏,但绝对是一些2D图形)。
  • The development environment must be easy to establish and the UI development tool must have drag&drop functionality to define application layout. 开发环境必须易于建立,UI开发工具必须具有拖放功能才能定义应用程序布局。
  • Target application must have native look and feel. 目标应用程序必须具有原生外观。 The professional paid support should be available. 应该提供专业的有偿支持。

All of these criteria are met by Qt, with the exception of "native look and feel". 所有这些标准都由Qt满足,但“原生外观”除外。 There is no such thing as a cross-platform framework with native feel, especially on OS X, where users are very demanding about the "feel" of applications. 没有具有本机感的跨平台框架,特别是在OS X上,用户对应用程序的“感觉”非常苛刻。 If you really want native look and feel, you are best served by writing a shared framework in C++ or C# and then providing native GUI on each platform (you can use MonoMac to provide a native Cocoa UI using C# instead of the native Objective-C, if that's your cup of tea). 如果你真的想要原生的外观和感觉,最好用C ++或C#编写一个共享框架,然后在每个平台上提供原生GUI(你可以使用MonoMac来提供一个使用C#而不是原生Objective-C的原生Cocoa UI ,如果这是你的一杯茶)。

That said, we've been very happy with Qt (and the Commercial support) for cross-platform development. 也就是说,我们对Qt(和商业支持)的跨平台开发非常满意。 Particularly the new OpenGL accelerated 2D Scene API makes animated UIs quite easy. 特别是新的OpenGL加速2D场景API使动画UI非常容易。 QtCreator is a decent IDE with visual designer support. QtCreator是一个体面的IDE,具有视觉设计器支持。

Contrary to others, probably due to the fact that I worked on a real-time trading Swing application, I consider Java to be the best answer to your requirements (however, i consider this question as subjective, as previous answers already shows). 与其他人相反,可能是因为我在一个实时交易Swing应用程序上工作,我认为Java是你的要求的最佳答案(但是,我认为这个问题是主观的,因为之前的答案已经显示)。 Let me develop. 让我发展。

It must be easy to install (run-time is a drawback, but C++ wrapper and/or installer can solve the issue I think). 它必须易于安装(运行时是一个缺点,但C ++包装器和/或安装程序可以解决我认为的问题)。

Using Java, you can rely upon Java Web Start , which is, as far as i know, the best solution for easy to use applications : you click a link on the browser, and the application is installed in start menu/desktop and started as soon as it is downloaded. 使用Java,您可以依赖Java Web Start ,据我所知,这是易于使用的应用程序的最佳解决方案:您单击浏览器上的链接,应用程序安装在开始菜单/桌面中并作为下载后立即。 Seems like Adobe AIR offers an equivalent feature, but to my mind Java Web Start integrates, due to the deepness of its ecosystem, far more powerfull distribution solutions (like, as an example, the easy ability to generate the .jnlp file on demand). 似乎Adobe AIR提供了相同的功能,但在我看来,由于其生态系统的深度,Java Web Start集成了更强大的分发解决方案(例如,根据需要轻松生成.jnlp文件的能力) 。

It must be fast and have a rich GUI (not 3D game, but definitely some 2D graphics). 它必须快速且具有丰富的GUI(不是3D游戏,但绝对是一些2D图形)。

Contrary to most popular belief, generating good graphics in Java is possible. 与大多数流行的观点相反,在Java中生成良好的图形是可能的。 Take as an example a look at excellent filthy rich clients companion site of the excellent book. 以一本优秀书籍的优秀肮脏富客户伴侣网站为例。

The development environment must be easy to establish and the UI development tool must have drag&drop functionality to define application layout. 开发环境必须易于建立,UI开发工具必须具有拖放功能才能定义应用程序布局。

Eclipse is a defacto industry standard for IDEs, and it integrate multiple DnD IDE builders. Eclipse是IDE的事实行业标准,它集成了多个DnD IDE构建器。 I would simply take as example the recently liberated Windows Builder Pro . 我只想举例说明最近解放的Windows Builder Pro

Target application must have native look and feel. 目标应用程序必须具有原生外观。 The professional paid support should be available. 应该提供专业的有偿支持。

Well, Swing default look'n'feel is indeed a little different from system one. 好吧,Swing默认look'n'feel确实与系统1有点不同。 however, there are excellent third-party ones, listed here , as an example. 但是,也有优秀的第三方的,上市这里 ,作为一个例子。

Finally, some examples : 最后,举一些例子:

  • the excellent Palantir Technologies blog list some outstanding Swing applications 卓越的Palantir Technologies博客列出了一些出色的Swing应用程序
  • Gephi is a rather complete and efficient high-volume graph viewer Gephi是一个相当完整和高效的高容量图形查看器
  • My previous work (don't consider it as a masked ad, it's only a way to show some rather solid Swing). 之前的工作 (不要将其视为蒙面广告,它只是展示一些相当稳固的Swing的一种方式)。

I would not recommend Java for desktop development. 我不推荐Java用于桌面开发。 I do not care what other say, Java is still slow compared to native languages like C++. 我不在乎别人怎么说,与C ++这样的本地语言相比,Java仍然很慢。 I would go with Qt. 我会选择Qt。 The IDE has a GUI builder and can be integrated into Eclipse or Visual Studio. IDE具有GUI构建器,可以集成到Eclipse或Visual Studio中。

Here's a helpful resource: http://qt.nokia.com/products/ 这是一个有用的资源: http//qt.nokia.com/products/

Have a look at Appcelerator Titanium : it basically wraps a web app in a browser. 看看Appcelerator Titanium :它基本上是在浏览器中包装一个Web应用程序。 You can have anything you want in a GUI using wen tech, but it looks like an ap[p. 你可以使用wen tech在GUI中拥有你想要的任何东西,但它看起来像是一个ap [p。

Strangely, nobody mentioned Real Studio (now Xojo ) which does meet all your requirements: 奇怪的是,没有人提到Real Studio(现在是Xojo ),它可以满足您的所有要求:

  • It is easy to install and does not require a separate run-time 它易于安装,不需要单独的运行时
  • It compiles to native code so is reasonably fast 它编译为本机代码,因此速度相当快
  • It has a good UI library that is native for each platform 它有一个很好的UI库,每个平台都是原生的
  • The IDE is very nice with drag and drop UI designers 通过拖放UI设计器,IDE非常好用
  • Target applications are fully native and use native controls 目标应用程序是完全原生的并使用本机控件

First of have to mention http://wxwidgets.org/ , one of the most popular X-platoform frameoworks. 首先要提到http://wxwidgets.org/ ,这是最受欢迎的X-platoform frameoworks之一。 Depending on the complexity of your application and the requirements to the "nativeness", a cross-platform framework may work for you. 根据应用程序的复杂性和“原生性”的要求,跨平台框架可能适合您。 The x-platform applications built with framework usually feel a bit "alien", especially on the Mac, but workable. 使用框架构建的x平台应用程序通常感觉有点“异类”,特别是在Mac上,但可行。 A good example is http://taskcoach.org/ . 一个很好的例子是http://taskcoach.org/

If your users are tolerant to hearty download sizes, hefty memory requirements and a bit of non-native look-and-feel then plain Java, eclipse RCP or NetBeans platform can work for you. 如果您的用户能够容忍丰富的下载大小,大量的内存需求和一些非原生的外观,那么普通的Java, eclipse RCPNetBeans平台都可以为您服务。 You may save quite a bit of development time going this route. 你可以节省相当多的开发时间。

However I am not aware of cross-platform framework that satisfies all your requirements. 但是,我不了解满足您所有要求的跨平台框架。

If you need to get to a production-level application, the strategy that I have seen worked best was to stay native but split the UI-dependent code into cross-platform (eg C++ business logic) and UI. 如果您需要访问生产级应用程序,我所看到的最佳策略是保持原生,但将依赖于UI的代码拆分为跨平台(例如C ++业务逻辑)和UI。 This way, you will use native interface building tools (each platform has something good there). 这样,您将使用本机界面构建工具(每个平台都有一些好的)。 Depending on the complexity and "finish" requirements of your application you may actually save time going this route. 根据应用程序的复杂性和“完成”要求,您实际上可以节省走这条路线的时间。

A great overview of the "Native X-Platform" process can be found in this answer by Chris Hanson . Chris Hanson在这个答案中可以找到对“原生X平台”过程的一个很好的概述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM