是否可以在 iOS、Android 或 Windows Phone 8 上运行 JavaFX 应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20860931/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 04:51:55  来源:igfitidea点击:

Is it possible to run JavaFX applications on iOS, Android or Windows Phone 8?

javajavafxjavafx-2

提问by mmm

Can one develop an entire application using JavaFX and run it on iOS, Android or Windows Phone 8, without writing platform-specific code?

是否可以使用 JavaFX 开发整个应用程序并在 iOS、Android 或 Windows Phone 8 上运行它,而无需编写特定于平台的代码?

采纳答案by ItachiUchiha

Background

背景

Invariant's answeris a good resource for how everything was started and what was the state of JavaFX on embedded and mobile in beginning of 2014. But, a lothas changed since then and the users who stumble on this thread do not get the updated information.

Invariant 的回答是一个很好的资源,可以了解 2014 年初一切是如何开始的以及 JavaFX 在嵌入式和移动设备上的状态。但是,从那时起发生了很多变化,偶然发现该线程的用户无法获得更新的信息。

Most of my points are related to Invariant's answer, so I would suggest to go through it first.

我的大部分观点都与 Invariant 的答案有关,所以我建议先通过它。

Current Status of JavaFX on Mobile / Embedded

JavaFX 在移动/嵌入式上的当前状态

Some bad news first:

先说个坏消息:

Now, some good news:

现在,一些好消息:

  • JavaFX still runs on Android, iOS and most of the Embedded devices
  • JavaFXPorts SDK for android, iOS and embedded devices can be downloaded from here
  • JavaFXPorts project is still thriving and it is easier than ever to run JavaFX on mobile devices, all thanks to the IDE pluginsthat is built on top of these SDKs and gets you started in a few minutes without the hassle of installing any SDK
  • JavaFX 3D is now supported on mobile devices
  • GluonVMto replace RoboVM enabling Java 9support for mobile developers. Yes, you heard it right.
  • Mobile Projecthas been launched by Oracle to support JDK on all major mobile platforms. It should support JavaFX as well ;)
  • JavaFX 仍可在 Android、iOS 和大多数嵌入式设备上运行
  • 可从此处下载适用于 android、iOS 和嵌入式设备的 JavaFXPorts SDK
  • JavaFXPorts 项目仍在蓬勃发展,在移动设备上运行 JavaFX 比以往任何时候都更容易,这一切都归功于构建在这些 SDK 之上的IDE 插件,让您在几分钟内开始使用,而无需安装任何 SDK
  • 移动设备现在支持 JavaFX 3D
  • GluonVM取代 RoboVM,为移动开发人员提供Java 9支持。是的,你没听错。
  • Oracle 已启动移动项目以支持所有主要移动平台上的 JDK。它也应该支持 JavaFX ;)

How to get started

如何开始

If you are not the DIY kind, I would suggest to install the IDE plugin on your favourite IDE and get started.

如果你不是 DIY 的那种,我建议你在你最喜欢的 IDE 上安装 IDE 插件并开始使用。

Most of the documentation on how to get started can be found hereand some of the samples can be found here.

大多数关于如何开始的文档都可以在这里找到,一些示例可以在这里找到。

回答by tomsontom

  1. yes you can run it on iOS and Android (Win8 is not supported!
  2. no deployment as a web-app does not work
  1. 是的,您可以在 iOS 和 Android 上运行它(不支持 Win8!
  2. 没有部署为网络应用程序不起作用

回答by invariant

Yes you can run JavaFX application on iOS, android, desktop, RaspberryPI (no windows8 mobile yet).

是的,您可以在 iOS、Android、桌面、RaspberryPI(还没有 windows8 移动版)上运行 JavaFX 应用程序。

Work in Action :

工作在行动:

We did it! JavaFX8 multimedia project on iPad, Android, Windows and Mac!

我们做到了!iPad、Android、Windows 和 Mac 上的 JavaFX8 多媒体项目!

JavaFX Everywhere

无处不在的 JavaFX

Ensemble8 Javafx8 Android Demo

Ensemble8 Javafx8 安卓演示

My Sample JavaFX application Running on Raspberry Pi

我在 Raspberry Pi 上运行的示例 JavaFX 应用程序

My Sample Application Running on Android

我在 Android 上运行的示例应用程序

JavaFX on iOS and Android

iOS 和 Android 上的 JavaFX

Dev Resources :

开发资源:

Android :

安卓 :

Building and deploying JavaFX Applications on Android

在 Android 上构建和部署 JavaFX 应用程序

iOS :

IOS:

NetBeans support for JavaFX for iOS is out!

NetBeans 不再支持 iOS 的 JavaFX!

Develop a JavaFX + iOS app with RoboVM + e(fx)clipse tools in 10 minutes

用 RoboVM + e(fx)clipse 工具在 10 分钟内开发一个 JavaFX + iOS 应用程序

If you are going to develop serious applications here is some more info

如果您要开发严肃的应用程序,这里有更多信息

Misc :

杂项:

At present for JavaFX Oracle priority list is Desktop (Mac,windows,linux) and Embedded (Raspberry Pi, beagle Board etc).For iOS/android oracle done most of the hardwork and opnesourced javafxports of these platforms as part of OpenJFX ,but there is no JVM from oracle for ios/android.Community is putting all together by filling missing piece(JVM) for ios/android,Community made good progress in running JavaFX on ios (RoboVM)/ android(DalvikVM). If you want you can also contribute to the community by sponsoring (Become a RoboVM sponsor) or start developing apps and report issues.

目前,JavaFX Oracle 优先级列表是桌面(Mac、windows、linux)和嵌入式(Raspberry Pi、beagle Board 等)。对于 iOS/android oracle 作为 OpenJFX 的一部分完成了这些平台的大部分努力和开源 javafxports,但是有oracle 没有 JVM 用于 ios/android。Community 正在通过为 ios/android 填充缺失的部分 (JVM) 将所有内容放在一起,社区在 ios ( RoboVM)/android( DalvikVM)上运行 JavaFX 方面取得了良好进展。如果您愿意,您还可以通过赞助(成为 RoboVM 赞助商)或开始开发应用程序并报告问题来为社区做出贡献。

Edit 06/23/2014 :

2014 年 6 月 23 日编辑:

Johan Vos created a website for javafx ports JavaFX on Mobile and Tablets,check this for updated info ..

Johan Vos 为移动和平板电脑上的javafx 端口JavaFX创建了一个网站,检查此更新信息..

回答by cubuspl42

Desktop: first-class support

桌面:一流的支持

Oracle JavaFX from Java SEsupports only OS X (macOS), GNU/Linux and Microsoft Windows. On these platforms, JavaFX applications are typically run on JVM from Java SE or OpenJDK.

Java SE 的Oracle JavaFX仅支持OS X (macOS)、GNU/Linux 和 Microsoft Windows。在这些平台上,JavaFX 应用程序通常在 Java SE 或 OpenJDK 的 JVM 上运行。

Android: should work

安卓:应该可以工作

There is also a JavaFXPortsproject, which is an open-source project sponsored by a third-party. It aims to port JavaFX libraryto Android and iOS.

还有一个JavaFXPorts项目,这是一个由第三方赞助的开源项目。它旨在将 JavaFX移植到 Android 和 iOS。

On Android, this library can be used like any other Java library; the JVM bytecode is compiled to Dalvik bytecode. It's what people mean by saying that "Android runs Java".

在 Android 上,这个库可以像任何其他 Java 库一样使用;在JVM字节码编译成字节码Dalvik的。这就是人们所说的“Android 运行 Java”的意思。

iOS: status not clear

iOS:状态不清楚

On iOS, situation is a bit more complex, as neither Java SE nor OpenJDK supports Apple mobile devices. Till recently, the only sensible option was to use RoboVMahead-of-time Java compiler for iOS. Unfortunately, on 15 April 2015, RoboVM project was shut down.

在 iOS 上,情况稍微复杂一些,因为 Java SE 和 OpenJDK 都不支持 Apple 移动设备。直到最近,唯一明智的选择是为 iOS使用RoboVM提前 Java 编译器。不幸的是,2015 年 4 月 15 日,RoboVM 项目被关闭

One possible alternative is Intel's Multi-OS Engine. Till recently, it was a proprietary technology, but on 11 August 2016 it was open-sourced. Although it can be possible to compile an iOS JavaFX app using JavaFXPorts' JavaFX implementation, there is no evidence for that so far. As you can see, the situation is dynamically changing, and this answer will be hopefully updated when new information is available.

一种可能的替代方案是英特尔的多操作系统引擎。直到最近,它还是一项专有技术,但在 2016 年 8 月 11 日已开源。尽管可以使用 JavaFXPorts 的 JavaFX 实现来编译 iOS JavaFX 应用程序,但目前还没有证据证明这一点。如您所见,情况正在动态变化,当有新信息可用时,这个答案有望得到更新。

Windows Phone: no support

Windows Phone:不支持

With Windows Phone it's simple: there is no JavaFX support of any kind.

使用 Windows Phone 很简单:没有任何类型的 JavaFX 支持。

回答by jeton

Possible. You can get commercial sport also.

可能的。你也可以获得商业运动。

JavaFXPorts is the name of the open source project maintained by Gluon that develops the code necessary for Java and JavaFX to run well on mobile and embedded hardware. The goal of this project is to contribute as much back to the OpenJFX project wherever possible, and when not possible, to maintain the minimal number of changes necessary to enable the goals of JavaFXPorts. Gluon takes the JavaFXPorts source code and compiles it into binaries ready for deployment onto iOS, Android, and embedded hardware. The JavaFXPorts builds are freely available on this website for all developers.

JavaFXPorts 是 Gluon 维护的开源项目的名称,该项目开发 Java 和 JavaFX 在移动和嵌入式硬件上良好运行所需的代码。该项目的目标是尽可能多地回馈 OpenJFX 项目,在不可能的情况下,保持实现 JavaFXPorts 目标所需的最少更改。Gluon 获取 JavaFXPorts 源代码并将其编译为二进制文件,准备部署到 iOS、Android 和嵌入式硬件上。JavaFXPorts 版本可在此网站上免费供所有开发人员使用。

http://gluonhq.com/labs/javafxports/

http://gluonhq.com/labs/javafxports/