A simple question from a new B4X member.

Peter Gonzalez

Member
Licensed User
Hello group!
I have read all the PDF files, read the forums and analysis the various programing codes in the website and still can find the answer to my question. Can I write one code and distribute this one code to a desk tops, I-Phone and Androids? Do I have to have 3 versions of one software? That is the impression I got when I first got recommended B4X to convert my MRP system.

Thanks,
-Peter G
 

Erel

Administrator
Staff member
Licensed User

sorex

Expert
Licensed User
indeed, you'll need 3 products of which one is free (B4J) so 3 projects (one for each product).

when using shared classes (or code modules) you can re-use almost all code between projects.

with product related conditions (#if B4A) you can cover the target related differences
altho XUI helps here and some code parts that where 15+ lines before are now half of it or less without any target conditions.

If you start your project smart from the start porting from Android to IOS is just a matter of one or a few hours.

Just don't rely too much on libraries if it is something you can write it yourself or you might be stuck when that library doesn't exist for some platform.
 

Peter Gonzalez

Member
Licensed User
You will have three projects. You can however share the modules between the three projects: https://www.b4x.com/android/forum/threads/b4x-modules-files-groups-and-folders.86587/#content
Overall it is a good thing that you have three projects as there are differences between the platforms and you don't want to be limited to the low common denominator.

Make sure to read about XUI library.
Hello Erel,
Thank you for the quick response to my question. I agree that having 3 UI is the best way to control how the software behaves on different devices. So, all devices will have different front ends (Java, IOS and Android) projects but share the same classes. These classes will then share the same business logic unless there is something specific about the front end.

I'll start with a simple customer maintenance screen in B4J and then B4I and then B4A. Wish me luck!

Toda!
-Peter G
 

Peter Gonzalez

Member
Licensed User
indeed, you'll need 3 products of which one is free (B4J) so 3 projects (one for each product).

when using shared classes (or code modules) you can re-use almost all code between projects.

with product related conditions (#if B4A) you can cover the target related differences
altho XUI helps here and some code parts that where 15+ lines before are now half of it or less without any target conditions.

If you start your project smart from the start porting from Android to IOS is just a matter of one or a few hours.

Just don't rely too much on libraries if it is something you can write it yourself or you might be stuck when that library doesn't exist for some platform.

Hello Sorex,
Thank you for responding to my question. Totally agree with you on libraries specially when you are trying to write a multi module business software. Controlling the code and making sure there are no surprises is critical.

The conversion will come from a character base using a 4GL interface that needs to be modernized. I'm also looking at interfacing with Sales Force since that is the standard for sales people.

Thanks,
-Peter G
 
Top