JavaFX on Android (Full Tutorial)

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ธ.ค. 2024

ความคิดเห็น • 43

  • @DanHowardMtl
    @DanHowardMtl 9 ปีที่แล้ว

    LOL. I love how when you started building I could hear your fan kick in. Happens to me all the time. I got your particle sample running this way too! Slow but it works!

    • @AlmasB0
      @AlmasB0  9 ปีที่แล้ว

      +Dan Howard Yeah, using a laptop, so pretty much any fan noise goes straight into the mic.

  • @jhicinternational
    @jhicinternational 7 ปีที่แล้ว +1

    Awesome! Watching all your videos back to back and they are all amazing. Kindly do further javafx applications if u can ..

  • @lapx2230
    @lapx2230 8 ปีที่แล้ว

    Hi, I often get the same error : finished with non-zero exit value 1. Do you know what this represents ? It never seems to be for the same issue.

  • @anmolkohli7723
    @anmolkohli7723 8 ปีที่แล้ว

    Hey Almas,
    I would like to tell you your tutorial is amazing.
    I am currently working on an android application in which I need to implement printing functionality without dialog box is this possible with JAVAFX sdk and if it is can I simply implement it using JAVAFX jar and if JAVAFX jar is not a good option then what should I do.
    Thanks in advance

  • @floridosmarpepa8904
    @floridosmarpepa8904 9 ปีที่แล้ว

    Does someone know how to add ads on app made with javafx and gluon plugin? I have made it work a sample application and now wanna try to make the ads work but don't know how to. thanks

  • @rafales1525
    @rafales1525 8 ปีที่แล้ว

    Thank You Sir for this tutorial- very halpfoul for me :) I also got question about how to load FXML file in classic way doesn't work- have many errors- any idea how to do this?

  • @sky-ar0ra1
    @sky-ar0ra1 9 ปีที่แล้ว

    How do you change the icon of the apk ?

  • @DCSTadi1337
    @DCSTadi1337 7 ปีที่แล้ว +1

    You sound like you have a good heart.

  • @AteKLobbyLobby
    @AteKLobbyLobby 9 ปีที่แล้ว

    good tutoriel but can you do the same tutoriel to use javaFX on android studio !

  • @vladislavkavunenko3839
    @vladislavkavunenko3839 9 ปีที่แล้ว

    It only works with 5.0.1 . In other versions of an error.
    Are there different in speed and android FXandroid?

    • @AlmasB0
      @AlmasB0  9 ปีที่แล้ว

      +Владислав Кавуненко Thanks for pointing that out. Yes I suppose the plugin has been tested with latest updates only. If by difference in speed you are referring to JavaFX code vs native Android code, then there shouldn't be much variation. As far as I'm concerned, the JavaFX API is natively implemented on Android so theoretically JavaFX code should be just as fast.

  • @floridosmarpepa8904
    @floridosmarpepa8904 9 ปีที่แล้ว

    Have someone tried to use it and making it work with scenebuilder and controllers class? I've putted the fxml file and the controller class in the same directory to make it visible by the scenebuilder, howerver when i link a method to a button in scenebuilder it pops out errors. Have someone make it working with scenebuilder and controller class? Thanks guys

    • @AlmasB0
      @AlmasB0  9 ปีที่แล้ว +2

      +Floridos Marpepa Hi, Scenebuilder uses the same directory (package) for identifying Controller for .fxml. However, the build system uses the Maven directory structure. So if you want to be able to use Controller + FXML, you will need to put Controller under src/main/java/dir/ and .fxml file in src/main/resources/dir/ where dir is the package name and must be the same in both cases.
      Keep in mind that you will need to manually specify fx:controller="full.package.name.Controller".

  • @clockwise3559
    @clockwise3559 8 ปีที่แล้ว

    Does anyone get a black screen when they try to add other JavaFX objects?

    • @clockwise3559
      @clockwise3559 8 ปีที่แล้ว

      +clockwise3559 happening consistently with buttons :/

  • @Majskolvenz
    @Majskolvenz 9 ปีที่แล้ว

    How is JavaFX for game development compared to a dedicated framework like libGDX? And can you make Android games (say a 2D platformer) that runs well with JavaFX?

    • @AlmasB0
      @AlmasB0  9 ปีที่แล้ว +1

      +Sebastian Hi, JavaFX can be used for game development, but unlike a dedicated framework, it lacks certain game development features, which you might have to implement. I have also been working on FXGL - github.com/AlmasB/FXGL to compensate for the lack of those features.
      Yes you can make simple Android games with JavaFX. Besides it runs natively and has access to hardware acceleration, so it's good performance-wise. All in all, it depends whether you'd like a cross-platform game or Android exclusive, your API preferences - JavaFX or Android but both are totally valid options

    • @Majskolvenz
      @Majskolvenz 9 ปีที่แล้ว

      +Almas Baimagambetov (AlmasB) Thanks for the reply. I can't find much documentation for using JavaFX for Android development and I'm not very experienced, so a few more questions if you don't mind. First off, how do I get get hardware access to for example the accelerometer using JavaFX? Do I have to use the Gluon charm framework thing or is there another way?
      Secondly, I want to use the SceneBuilder tool to create FXML files that I use for my UI, but I don't know how to make my FXML layout fit to the phone screen properly. I tried giving the root AnchorPane in my FXML file a size of 960x540 to make it have the aspect ratio of a phone, but most of the AnchorPane is off-screen when I run it on my phone.

    • @AlmasB0
      @AlmasB0  9 ปีที่แล้ว

      Sorry, I may not have been very clear in my answer, so to clarify: JavaFX has access to "hardware acceleration" (GPU based rendering) but apart from that it only has features you have on a desktop version of JavaFX. At the end of the day it's just a graphics toolkit. If you want to use the phone hardware then you will need to use Android API together with JavaFX. Here's a short example - docs.gluonhq.com/javafxports/#_nfc . Unfortunately, this is as far as it gets when trying to find documentation for JavaFX Android. Regarding SceneBuilder, I don't think you can hardcode the size, because of different device screens, it would be best to use visual bounds of the screen and set size dynamically. It sounds like you would be better off with standard Android development.

    • @floridosmarpepa8904
      @floridosmarpepa8904 9 ปีที่แล้ว

      +Almas Baimagambetov (AlmasB) Sorry but i don't get how to link my fxml file to my main java class. I have tryed FXMLloader but can't get it work, i have make the fxml file in the resource file like the icon.png location. The layout loads but then in scene builder can't link the controller class to it. It doesn't see it. Help

  • @ravishlawaniya6835
    @ravishlawaniya6835 7 ปีที่แล้ว +2

    Very Informative !!! Thanks

  • @ondrejzapadlik5913
    @ondrejzapadlik5913 8 ปีที่แล้ว

    Hi, do you think this is a good way to create for example 2D tile based game for android,iOS and desktop ?? Are there any limitations?

    • @AlmasB0
      @AlmasB0  8 ปีที่แล้ว +1

      Hi, I'd suggest using libGDX for what you describe. JavaFX on android doesn't have as much support beyond basic proof-of-concept implementation, while libGDX has a lot of tutorials you can make use of during development.

    • @ondrejzapadlik5913
      @ondrejzapadlik5913 8 ปีที่แล้ว

      When i started to learn programming (year ago), i didn't like how the code looks with libgdx (too much "informations" ). So i made my first game with javafx and had no problem with that at all. But since i want to create a game for android i believe that you are right and i'm going to face the libgdx :D Thanks :)

  • @buggxs
    @buggxs 6 ปีที่แล้ว

    hey i could check the support library because it doesnt exist anymore... Can you help me ? :)

    • @talmidhamilah
      @talmidhamilah 6 ปีที่แล้ว

      No android sdk manager você deve marcar para mostrar opções obsoletas e ira aparecer a biblioteca de suporte.

  • @silva-vini
    @silva-vini 8 ปีที่แล้ว

    Hello, thank you very much for your tutorial, it was definitely very helpful.
    However, I would like to build JavaFX based apps to run on a x86 Android device, not ARM. Do you know how can I do this?

    • @AlmasB0
      @AlmasB0  8 ปีที่แล้ว

      +Vinícius Oliveira Hi, I haven't used x86 Android so I wouldn't know. However, I'd guess that it might be quite difficult, if not impossible. The reason behind my suspicion is that most of JavaFX mobile SDK contains native code. The best bet in your case is to contact someone from gluon - authors of the mobile SDK.

  • @veerendrajetty9724
    @veerendrajetty9724 5 ปีที่แล้ว

    Hi, is it possible to convert javafx desktop app to Android and iOS?

    • @AlmasB0
      @AlmasB0  5 ปีที่แล้ว

      Hi, yes, please see github.com/gluonhq/client-maven-plugin and also javafx mobile plugin

  • @jithendrasai
    @jithendrasai 7 ปีที่แล้ว

    hi, i am new to this, is there a way to use this javaFX directly in android studio

    • @AlmasB0
      @AlmasB0  7 ปีที่แล้ว

      Hi, JavaFX is a UI toolkit, mainly for desktop apps. If you use native Android UI, there is no need to include JavaFX. So I'm not quite sure what you are trying to achieve.

  • @mahmoudchebbani4807
    @mahmoudchebbani4807 9 ปีที่แล้ว +2

    you sir are awesome !

  • @naghmakhan8654
    @naghmakhan8654 8 ปีที่แล้ว

    hi (hoping that u will respond), i have got a problem when i try to install the gluon plugin
    i have gradle 2.14 ,and esclipse mars .1 and also have the android SDK manager
    (is it complusary to follow your track of downloading stuff,coz i already had android SDK)
    error:
    An error occurred while collecting items to be installed
    session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
    Unable to read repository at download.gluonhq.com/tools/eclipse/updates/1.0.0/plugins/org.springsource.ide.eclipse.gradle.toolingapi_3.7.0.201506251228-RELEASE.jar.
    Read timed out
    i have win10 64bit
    help me please :)

    • @AlmasB0
      @AlmasB0  8 ปีที่แล้ว

      Hi, I do not know what the problem might be. Have a look at this original tutorial: gluonhq.com/the-new-gluon-plugin-for-eclipse/ , it might be able to help you. If the error persists, I suggest that you do a clean install of all the software that is required.

    • @naghmakhan8654
      @naghmakhan8654 8 ปีที่แล้ว

      ok thank u :)

  • @cybern9ne
    @cybern9ne 8 ปีที่แล้ว

    Now you get a nag screen to pay for a license.

    • @JuanCarlos611
      @JuanCarlos611 6 ปีที่แล้ว

      A little too late, but you can get the same results (without the nag screen) using the javafxports plugin (not the Gluon plugin, which itseld is based on javafxports)). If you're not afraid of command line and editing gradle files by hand, that is.