Android Question Does the B4x package have tools to automatically translate B4j code to B4a code?

oleg_

Member
Licensed User
If I understand correctly, in the B4j language you can create programs for Windows, and in the B4a language you can create programs for Android. Moreover, these languages are very similar to each other.
I'm wondering if there is any tool in the B4x package to automatically translate B4j code into B4a code or will I have to do it manually?

I'm an amateur, not a professional. I write all programs only for myself. Is the following tactic possible for me?
I create all the programs in B4j so that they run on a desktop Windows computer, and I translate some of these programs (automatically?) into B4a code and use these programs on the Android tablet? Or is it easier to create programs for an Android tablet right away in the B4a language?
 

klaus

Expert
Licensed User
Longtime User
I suggest you to directly begin with a B4XPages project.
You may have a look at the B4X Getting started booklet.
The first project 'MyFirstProgram' is a B4XPages project.
The advantage is that almost all code is common to all three platforms.
 
Upvote 0

oleg_

Member
Licensed User
jahswant, thanks for the answer.
I can’t say that I understood everything from this, since I’m just starting to get acquainted with all these products. But I've still understood the main thing: there is a way to translate B4J to B4a automatically or almost automatically, and it is very good.
 
Upvote 0

oleg_

Member
Licensed User
klaus, thank you very much for the advice!
At the beginning of the journey, I really want to choose the right direction to move and you help me just with this.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Welcome to the B4X community @oleg_

Once you have studied the B4X getting started booklet that has been expertly written by @klaus, I would recommend that you quickly looking at this cross platform example(s) (a simple Simon Says game) in the links below. This cross platform example is basically one set of code that is running the same game example on Android, iOS, Windows and MacOS operating systems. This is a relatively simple one code fits all example for beginners. As long as you use B4XPages with XUI, you should be able to accomplish most (if not all) of the cross platform projects you would probably like to create.

The two links below are for B4A (Android) and also B4J (Desktops), they download the exact same zip file and share the same simple to follow source code. You can open the project twice (one in B4A and the other in B4J) and for example when you change the source code in B4A, you will see the source code changes happen in B4J just a few seconds later.

B4A tutorial page

B4J tutorial page


Enjoy...
 
Last edited:
Upvote 0
Top