How to reference android.jar in Gluon project
Above is my Gluon project for deploying JavaFX on Android. My problem is that I cannot link to android.jar. How to solve this problem?
build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b9'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
}
mainClassName = 'com.raes.Main'
jfxmobile {
android {
manifest = 'src/android/AndroidManifest.xml'
}
ios {
infoPList = file('src/ios/Default-Info.plist')
}
}
source to share
When you create a JavaFX project using the Gluon plugin for NetBeans, four main packages are created by default:
- Source packages [Java]
- Desktop / Java packages
- Android / Java packages
- Ios / Java packages
and four resource packs.
Also, if you are checking dependencies, there are exclusive dependencies for android (android.jar and jfxdvk jar) and for iOS (robovm jars) by default.
This means that you can place Java-code in any of four specified areas, but you can use these relationships only in their specific area: you will be able to add, depending on the android only under Android / Packages Java.
If you look at HelloPlatform in the samples section of the JavaFXPorts repo, you can see a way to solve the problem platform specific code from the main application.
Also check this project as it already includes Bluetooth dependencies Bluetooth and see how they are called from the main class using PlatformFactory
which loads at runtime the class AndroidPlaftorm
if you are using a JavaFX app on an Android device.
source to share