Android Question Same code base, multi platform

mmanso

Member
Licensed User
Hi there,

Id like to write an app to run on linux and android.

Can this be done using the same codebase and b4a and b4j?

I beliave the ui part is diferent. Is there any technique in this technologies to deal with these issues?

Cheers.
 

mmanso

Member
Licensed User
Hi there,

Thanks. But, in your oppinion, the UI part of it needs to be different for both platforms, right? Imagine I've an app with 100 screens. I'll have to define them twice, correct?
 

sorex

Expert
Licensed User
It depends on how you structure your app and if you generate everything by code or with the designer.
 

mmanso

Member
Licensed User
It would be perfect if there was a way to write an app once and have it running on multiple platforms. You kinda do that, but on the UI side of if, has I understood, it's not "generic".

If the UI is generated by code (not using the desinger) the API will be the same for everything, or Android has a different API than JavaFX? I mean, in the B4? API...
 

mmanso

Member
Licensed User
I "almost" agree with you :)

In the industry I work for (Hospitality) the hardware manufactures are creating Android machines (POS) that are exactly the same as a i386 machine. The only difference is the board inside the machine.

So, in terms of development, that's not a "mobile app". It's a regular app, on a regular machine but running on Android.

In this "concept", the app is the same in Android or in Windows or Linux.

This is the problem I'm trying to tackle here.
 

sorex

Expert
Licensed User
you can make them look simular the question is if they use 1 project for all 3 of them? doubt it.
 

mmanso

Member
Licensed User
They don't, because I don't know any technology that allows that.

Actually, what I know that handles this in that way is something called kivy. It's a python project.

After evaluating B4A, I love it's IDE and the way we code. That's why I was trying to figure out if the project we're starting could (or not) use this.
 

sorex

Expert
Licensed User
you can move most of the code to modules that you can share between the 2 projects and work with conditional compilation as Erel suggested.

if a lot is different the source might grow a lot compared to seperating everything but it's easier to maintain both when applying small fixes that are easily forgotten untill you update the other one again.

Didn't use it myself yet but I intend to do since I focus on both systems from now on.
 
Top