Java Reference
In-Depth Information
Figure 12-15. Screenshot from a real iPhone running the SimplePort application after the Guess a day button
was clicked
JavaFX on Android
The Android platform is Google's operating system for mobile devices and tablets. It is expanding to more and more
devices, ranging from wearable devices to televisions and car computers. Android is a Linux-based system, using the
Dalvik VM. There are many similarities between the Dalvik VM and the Java VM, but they are not exactly the same.
Most of the standard Java packages are also available in Dalvik, but not all of them.
The JavaFX Android porting project is based on the OpenJFX project. The code and documentation for this
project is available at http://bitbucket.org/javafxports/android .
Most of the native code required to build the JavaFX platform and to execute JavaFX Applications on the Android
platform is available in the OpenJFX repository. The Java classes that are needed by the JavaFX Platform and that are
not available in Dalvik are added in the JavaFX Android porting project.
At the time of this writing, creating an Android application (or an APK bundle) is achieved using command-line
tools that are provided by the JavaFX Android porting project.
The following steps have to be performed:
1.
Download and install the latest Android SDK, which can be found at
http://developer.android.com/sdk/index.html .
2.
Download the JavaFX Dalvik SDK. Make sure you have the latest version of the JavaFX
Dalvik SDK, available at https://bitbucket.org/javafxports/android/downloads .
3.
Create a regular JavaFX application. This can be any JavaFX application you also use for
desktop purposes. However, at this moment the JavaFX Android project does not support
Java 8 code.
 
Search WWH ::




Custom Search