Which Java distribution 'level' does Gluon

2019-03-01 12:15发布

问题:

Apologies, I'm new to both JavaFX and Gluon Mobile.

As JavaFX is/was a desktop API, I'm trying to understand exactly which level of API's Gluon Mobile exposes (compiles against) for Android and IOS? This doesn't seem to be made explicitly clear.

Once this is understood, I can better understand if I'm able to use some 3rd party API's I'm interested in, which utilise JavaSE desktop API's (specifically Javax sound), on mobile (via Gluon).

回答1:

You may want to have a look at the Gluon's knowledge base about Java 8 and JavaFX 8 features.

At the moment, Android is using the Harmony implementation of the Java SE API’s, which is somewhere between Java 6 and Java 7. This means that new Java 8 features like lambdas and streams are not supported. For both cases there are workarounds like the retrolambda and the streamsupport projects.

As for JavaFX 8 features, Media API or Printing API are not included yet.

But if you need it, you can include in your project a native solution. Have a look at the GoNative sample for a use case. Media could be added as well via NDK.



回答2:

OK, I read Oracle's Writing JavaFX Applications for Mobile Devices and:

the internal implementation of JavaFX 8 on Android and iOS does not use Java SE 8–specific APIs

The quote above relates to the usage of OpenJFX on mobile, which Gluon Mobile itself is based upon.

So there we have it, no JavaSE Desktop in Gluon Mobile/Mobile JavaFX apps.