Comments on: How to Create Mobile Apps with JavaFX (Part 2) https://foojay.io/today/creating-mobile-apps-with-javafx-part-2/ a place for friends of OpenJDK Sun, 01 Jan 2023 12:12:15 +0000 hourly 1 https://wordpress.org/?v=6.9.4 By: Turn A Webpage Into A Desktop App With Gluon – Hackaday – Web Generation https://foojay.io/today/creating-mobile-apps-with-javafx-part-2/#comment-7745 Sun, 01 Jan 2023 12:12:15 +0000 https://foojay.io/?p=45105#comment-7745 […] as Android & iOS apps, which is confusingly close to the same problem space as this tool.e.g. https://foojay.io/today/creating-mobile-apps-with-javafx-part-2/How does it compare to Progressive Web Apps (PWAs)?Please be kind and respectful to help make the […]

]]>
By: Siegfried https://foojay.io/today/creating-mobile-apps-with-javafx-part-2/#comment-2650 Thu, 03 Mar 2022 08:14:03 +0000 https://foojay.io/?p=45105#comment-2650 Hello @Gail, @JPeredaDnr, thank you very much for the support and your detailed information! Now I understand more and more about JavaFX development for Android and this information will help me very much! And thanks for adapting JavaFX to Android, great work!

]]>
By: Gail Anderson https://foojay.io/today/creating-mobile-apps-with-javafx-part-2/#comment-2452 Thu, 10 Feb 2022 19:40:07 +0000 https://foojay.io/?p=45105#comment-2452 Hi Siegfried,
Thanks for the comment and questions. Your questions sent me checking with those more involved in the Android-specific Gluon Substrate details than I am. Here is a response from @JPeredaDnr, engineer extraordinaire at Gluon:

Android runs its own 1.7 JVM, and we [Gluon substrate] add ours (via GraalVM, 17), and both need to communicate.
If you check your project, under target/gluonfx/aarch64-android/gvm/android_project, there is a full Android project (you can open it with Android Studio). This is created by Substrate.
It has the main activity set as com.gluonhq.helloandroid.MainActivity, which is just the bootstrap activity to launch the “real” app, that runs under libsubstrate.so, by starting the graal thread: https://github.com/gluonhq/substrate/blob/master/src/main/resources/native/android/android_project/app/src/main/java/com/gluonhq/helloandroid/MainActivity.java#L130
In any case, from the Android point of view, this is the entry point, and therefore it has to be present in the AndroidManifest.

In theory you could rename this main activity to your liking, but you will most likely get tons of issues…

For the second question on running an android app in full immersive mode, you can’t specify immersive mode in the AndroidManifest file. So you have to use Attach [the Gluon way to access system or device-specific features]. Attach doesn’t have that service yet, but it should be fairly easy to do. You need to modify some of the Intents with those flags.

You can create a service with AttachExtended, and give it a try, or if you need to modify the MainActivity you can manually build the apk:

mvn -Pandroid gluonfx:package
cd target/gluonfx/aarch64-android/gvm/android_project/
export ANDROID_SDK_ROOT=~/.gluon/substrate/Android
./gradlew app:assembleDebug

and then resume

mvn -Pandroid gluonfx:install…

]]>
By: Siegfried https://foojay.io/today/creating-mobile-apps-with-javafx-part-2/#comment-2370 Mon, 31 Jan 2022 14:22:21 +0000 https://foojay.io/?p=45105#comment-2370 Lately as of your inspiring article I have been playing around with the example and some small proof-of-concept project for android. I am a newbie to android development but with the approach described by your article I got a simple demo up and running on my phone 🙂

Now I have two questions regarding the screen orientation and the navigation bar (the bottom bar) on the screen of the phone:

1) Manipulating the AndroidManifest.xml I was able to get a landscape orientation changing the com.gluonhq.helloandroid.MainActivity activity though in the code I did not find any com.gluonhq.helloandroid.MainActivity class. Is the name irrelevant or is there some such default activity?

2) Do you know how I can hide the navigation bar (the bottom bar)?

Thanks beforehand! 🙂

]]>
By: Gail https://foojay.io/today/creating-mobile-apps-with-javafx-part-2/#comment-1001 Mon, 06 Sep 2021 21:08:54 +0000 https://foojay.io/?p=45105#comment-1001 As per the Gluon documentation: “Native image is only supported on 64-bit platforms.”

]]>
By: Anonymous https://foojay.io/today/creating-mobile-apps-with-javafx-part-2/#comment-992 Sun, 05 Sep 2021 20:50:24 +0000 https://foojay.io/?p=45105#comment-992 Hi, I was able to build and package my application into an apk. However, the apk only runs on a select few android devices. It doesn’t run on my 32 bit cpu Samsung for instance. What can I do to fix this?

]]>
By: Buddu Edgar https://foojay.io/today/creating-mobile-apps-with-javafx-part-2/#comment-827 Sun, 01 Aug 2021 18:02:39 +0000 https://foojay.io/?p=45105#comment-827 Dear Paul & Gail,

I am using the gluonfx gradle build task with graalvm native-image … how do I enable android apk to be generated with MultiDexEnabled=True ??..
When I run the apk to start some services, the JVM complains that: Didn’t find class on the DexPathList … The solution provided by google is to enable multiDex …

Edgar

]]>
By: Javier Faus Llopis https://foojay.io/today/creating-mobile-apps-with-javafx-part-2/#comment-646 Fri, 02 Jul 2021 11:18:07 +0000 https://foojay.io/?p=45105#comment-646 Just to let you know that you can add the link to the Part 3 as it has already been published. Thanks a lot for sharing.

]]>