Gluon-mobile

I’m in the process of working through the documentation for Gluon-Mobile. With this tool, and JavaFX, it is supposedly possible to produce Android and iOS apps using Java and JavaFX. Being a fan of JavaFX, this could potentially work out quite nicely.

I’m curious if others have tried this approach for writing apps, and what success they have had or not.

True to form, I’m making every configuration mistake in the book as I inch forward, but I think I’m pretty close to getting their HelloFX example to run on my Android phone. The documentation strikes me as pretty good but a bit terse (I’m a big fan of disambiguating redundancy in “guides”) and maybe due for a “freshen up”. But on the plus side, it seems Gluon has an employee that tracks and answers questions on StackOverflow that have the Gluon tag. I’ve always gotten a reply same day, or early on the next day if I post late.

1 Like

Was using Gluon earlier this year to do Raspberry Pi embedded stuff. It was painfully slow progress, and we had paid support too (they are very helpful and responsive mind!)

Got to the point of trying to get GraalVM running the code AOT but project got iced for the meantime right in the middle of it. Might get back to it in the autumn.

Cas :slight_smile:

3 Likes

On the plus side, I finally found the section of the documentation that simply runs through the steps required for building and installing on the Android device, and it all ran pretty smoothly (with help from Jose Pereda as StackOverflow), until I got to the last step. Turns out my Android device is 32-bit and GraalVM only supports 64-bit!

So, a new phone has been ordered.

The fellow I’m working for (assuming I get establish proof-of-concept on both Android and iOS for Gluon-Mobile) is OK with his app being limited to 64-bit phones. So, onward! But I am wondering what the distribution of 32-bit to 64-bit phones is for the user base. There doesn’t seem to be an obvious place to find this out. Android supports some good sites for showing the screen sizes, densities and Android versions, but not CPUs.

Articles I’m finding make it look like no one is making 32-bit phones any more. Maybe there are just refurbished phones at 32-bit? Those, and the older phones held by penny-pinchers like myself that resist change.

1 Like

Interesting about Gluon and GraalVM.
I haven’t used either but I recently installed AndroidStudio on my computer to try the CameraX API on the android phone for barcode scanning and had a good experience after the initial pain of installing it.
They force you to learn Gradle and Kotlin which is bizarre.
After trying and failing at many tutorials that may have been out of date, I finally found these two that worked:


https://medium.com/swlh/introduction-to-androids-camerax-with-java-ca384c522c5

What’s your client’s application, Phil?
Since the pandemic, some (non-dev) firms have said that they will ditch company-provided laptops and run everything on phones. Seems to be the way of the future

1 Like

I don’t exactly know, and once I do, I probably won’t be able to say. He wants me to sign an NDA. I’m avoiding taking that step and actually charging money until I verify that the work path: making the app with Java/JavaFX and porting to Android and iOS is going to work. It’s a two-fer for me in that I have some audio-based app ideas that I’ve always wanted to write, so this is a good excuse to give it a go.

For a while, I was telling myself that browser-based apps might be a way to leapfrog having to deal with Android or iOS directly. I’m putting a lot of time (brain is fried) into working on Spring Boot/Thymeleaf/HTML-CSS-Javascript architecture.

Seems like Android/Google has been doing their best to push people to use Kotlin over Java. The Android Studio track I was taking used Java, and consisted of a github course on Android Fundamentals from Google. It’s three years old now, so probably a little stale–might be good to check if there is a v3.

1 Like

I did get a Gluon-Mobile “HelloFX” app running on my Android phone a few days ago! I’m wondering about writing up a little guide of some sort, but most of the errors I made were pretty elementary, on the scale of getting mixed up about the namespaces for environment variables (e.g., if you make an env var for your User, it won’t be present for sudo) and attempting to compile onto a phone that was using a 32-bit instruction set.

Main things:

  1. For the Gluon-Mobile documentation, just read, do not try to follow steps until you get to the explicit steps written for the “HelloFX” tutorial. The documentation is somewhat confusing in how it is presented, and can easily lead astray if you attempt to closely follow things exactly in the order presented. Just use it for background until you get to the explicit steps.

  2. Know that the Media portion of JavaFX (audio and video operations) aren’t supported on Android/iOS. This was pretty disappointing to me, but it makes sense. Given that the audio hooks provided by JavaFX are lame, maybe it’s for the best. To use the audio that is supported on Android/iOS, one has to work through a tool called Attach. IDK how well this works, haven’t tested it yet. Also, the path between Gluon-Mobile code and the Android/iOS code may be “one way”. Need to verify this. A lot of my audio makes use of messaging from the audio processing back to game state, and IDK if i’d be able to get this to work.

  3. Support is excellent. Use StackOverflow and tag with Gluon-Mobile. Gluon must have someone on staff, as answers usually arrive within a couple hours.

I strongly recommended to my client that he hire someone who can code in Android directly. I think trying to get something complicated done (coordinating audio and gui visuals) probably will go much better without things sitting in the way like “Attach”. I’m back-burnering my hopes of making apps via Gluon-Mobile for now.

1 Like