Can I use Java to create cross-platform mobile applications?

I read an article that Xamarin bought RoboVM and allows developers to write mobile applications in Java for cross-platform. I'm not sure that Java can now be used to develop cross-platform mobile applications. Are there any reliable tools where I can write in Java for developing cross-platform mobile applications? A good choice for choosing Java only for potential cross-platform mobile applications? I do not consider using C, C ++, C # for this purpose, since I never focused on one of them. I apologize for the fans of these pagans. Or am I better off working with Java for Android apps and Swift for iOS apps? I plan to choose Java as the main language for all web applications, cross-platform mobile applications and the development of robotic programs.

+5
source share
3 answers

I have been using Codename One for quite some time. Libgdx was not exactly an option, as I am not a game developer.

I played a little with RoboVM before choosing Codename One, and it seems to be more about Java for iOS, not WORA (Write Once Run Anywhere). This may be a good choice for you if you want it, but I prefer WORA. I tried RoboVM FX bindings and they were just terribly broken for the main reasons.

A few things I like about Codename One:

  • Support. I have never used a product with such wonderful free support. You get answers no later than the day, and it really sealed the deal for me.

  • There is no need for a Mac - I use my Mac at home, but in the office I need a computer.

  • Setting up and getting to know is pretty much Swing, but WAY is better. As we always wanted Swing to be, as they put it ...

The documents used for sucking, but they made a big push, and it shows. Now, if they could fix the IntelliJ / IDEA plugin to the NetBeans plugin level, I would be golden!

+6
source

As far as I know, they are incompatible with Java, but they claim that if you know Java, you'll be fine with C #.

I found some interesting strange facts on my transition site ... source

  • In Java, you can pass parameters only by value, and in C # - by reference, as well as by value. (C # contains the keywords ref and out to pass parameters by reference; there is no equivalent in Java).
  • In a Java statement, the code may go to the next section of the switch, but in C # the end of each section of the switch must end the switch (the end of each section must be closed using the break statement).
  • ....
0
source

Depending on what you are trying to write, libgdx might be a good solution.

You write your code once in java and it compiles basically everything (even html5!)

You must adhere to your coding rules and use its classes. (Which is great for game development, not for other things ... but you can still do whatever you want).

0
source

Source: https://habr.com/ru/post/1245742/


All Articles