• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Problem for generating a JavaFX application for mobile, with Eclipse + Gluon

dutpas

Lurker
Hi,

I have some problem for running a JavaFX application on mobile (ex: Archos Diamond S with Android 5.1)

First of all, I have created a simple "Hello world" JavaFX application on Eclipse (SDK Mars.2 - 4.5.2).

Then, for generating an Android application whereas my source language is JavaFX, I have installed Gluon (with its JavaFXports) on Eclipse.
And, now, in Eclipse, there is the "Gradle tasks" tab. Fine!

Moreover, I have connected my mobile to my desktop through the USB port. My PC recognizes it (a popUp is automatically displayed with the mobile name and some mobile options as: "Synchronize ..", "import..", ....

Now, last step to do (I hope), when I launch the Gradle task "AndroidInstall", it seems to be that my mobile should display the generated Android application. But nothing appears on my mobile.

I have searched a file *.apk in my desktop, without success.

Note that when I choose "Run" as a Gradle task, my application works fine on my PC.

Have you an idea about this problem PC-mobile?

Thank you for your response
 
Did the build complete successfully? Were there any errors in the console? Did you configure the Android SDK correctly?
Does this tutorial help?

 
Did the build complete successfully? Were there any errors in the console? Did you configure the Android SDK correctly?
Does this tutorial help?

Yes, the build is successful. No error mentioned
And I work with Eclipse + Gluon, not with Android SDK
I work with Java8 (Retrolambda is necessary?)
Now, I make some additional tests for easing the analysis
 
Um, if you wish to create an Android app, you will need the stand-alone Android SDK, otherwise building an Android APK is impossible. Please watch the tutorial.
 
Um, if you wish to create an Android app, you will need the stand-alone Android SDK, otherwise building an Android APK is impossible. Please watch the tutorial.

In fact, before launching the ""androidInstall" " gradle task, it is necessary to install the API21 (platform android-21), in AppData\Local\Android\sdk\platforms\android-21

API19 and API 23 do not work and no any message is logged in Eclipse "Error log"
 
What do you get in your Eclipse console window? Does it show a successful build?
 
Great that you got it working. I'm still a bit confused as to how a complex JavaFX application translates to an Android app. It's quite easy to generate a simple 'hello world' app, but the programming models are completely different. They both achieve similar things, but do it in a radically different way. For example JavaFX has no concept of Activities, Intents, and how does it translate to all the corresponding UI widgets?
If it does work properly there is some extremely clever stuff going on in the background to do all this. I would say any remotely complex Android app that you are building from scratch needs to be coded using the Android SDK directly. There is maybe a place for this JavaFX translation system for existing JavaFX applications, but I'm fairly sceptical about how good a job it would do.
But best of luck with your project.
 
LV426,
I understand your opinion. But, the simple "hello world" that I said already included some major JavaFX notions for a video game: Transitions (Rotation, Translation, Scale, Fade, Parallel), Timeline, Image, Background, Node and Group.
I'm not sure that all JavaFX notions can be translated, through JavaFX ports and Gluon, to Android, but I hope so.

As you know well the potential problems in that use, perhaps can you provide among these used classes, those with problem?

Thank you

In practice, I use:
import javafx.animation.Animation;
import javafx.animation.Animation.Status;
import javafx.animation.FadeTransition;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.ParallelTransition;
import javafx.animation.PathTransition;
import javafx.animation.RotateTransition;
import javafx.animation.ScaleTransition;
import javafx.animation.Timeline;
import javafx.animation.TranslateTransition;
import javafx.application.Application;
import javafx.application.ConditionalFeature;
import javafx.application.Platform;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.event.ActionEvent;
import javafx.geometry.Insets;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressBar;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.effect.ColorAdjust;
import javafx.scene.effect.InnerShadow;
import javafx.scene.effect.MotionBlur;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCode;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Background;
import javafx.scene.layout.BackgroundImage;
import javafx.scene.layout.BackgroundPosition;
import javafx.scene.layout.BackgroundRepeat;
import javafx.scene.layout.BackgroundSize;
import javafx.scene.layout.FlowPane;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.paint.Color;
import javafx.scene.shape.ArcTo;
import javafx.scene.shape.ClosePath;
import javafx.scene.shape.Ellipse;
import javafx.scene.shape.Line;
import javafx.scene.shape.LineTo;
import javafx.scene.shape.MoveTo;
import javafx.scene.shape.Path;
import javafx.scene.shape.PathElement;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.Shape;
import javafx.scene.shape.Sphere;
import javafx.scene.transform.Rotate;
import javafx.stage.Popup;
import javafx.stage.Screen;
import javafx.stage.Stage;
import javafx.util.Duration;
 
I can't advise on those classes because I've never used JavaFX.
I was merely commenting on the difficulties of translating application code from one system to the other.
And let's suppose your Android app crashes, and you get hold of a stack trace to try and diagnose the problem. This will be virtually meaningless to you, and extremely difficult to solve, because it probably references application code that you didn't even write!
 
I can't advise on those classes because I've never used JavaFX.
I was merely commenting on the difficulties of translating application code from one system to the other.
And let's suppose your Android app crashes, and you get hold of a stack trace to try and diagnose the problem. This will be virtually meaningless to you, and extremely difficult to solve, because it probably references application code that you didn't even write!
Tomorrow,I will "transfer" my Java code on mobile ..... Wait and see
 
Back
Top Bottom