Android Question XUI vs B4A

Lakhtin_V

Active Member
Licensed User
Longtime User
I have been using B4A for many years, with this version I solved a variety of problems using mobile devices. 20 years ago I programmed applications for Windows, now only mobile applications. I do not understand the development strategy of B4A. My very subjective opinion is that it would be ideal if there was a universal basic version B4A, which was based on all XUI technologies. Most importantly, I would like such a version to be able to run on iPhone and Android via a bridge, and of course just on Windows. I understand that programmers will have to take into account the differences in screen sizes, but I think that such versatility is more important than some losses in functionality. Can we hope for the emergence of a universal B4X(XUI) platform?



Now many examples are made with XUI technology, but they can be used if the project was originally made on B4A(XUI). If this technology is so good, it would be better to make a version of the platform with support for XUI by default, but then I would like to get the ability to debug on Android and iPhone from one platform at once from the new platform.
 
Last edited:

aeric

Expert
Licensed User
Longtime User
I totally don't get your point.
XUI and XUI Views are already existed for so long time. There are UI libraries that make your B4A, B4i and B4J works at the same time or as a single code base. What is missing here?
 
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
I totally don't get your point.
XUI and XUI Views are already existed for so long time. There are UI libraries that make your B4A, B4i and B4J works at the same time or as a single code base. What is missing here?
Thank you for your response. I want to clarify my question. If I have already started developing a project in the classic basic version of B4A, then I cannot immediately use the code from the example written using XUI, the conflict occurs at the level of formatting interface elements. I conclude that I should initially work using XUI. But what if a useful example is written using B4A? Maybe it would be better to make everything related to XUI available by default?
 
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
For example, I am starting to work on a new project now. I am currently working on the interface of the first screen. I always describe the interface programmatically without using a designer. Then it would be logical to immediately create the interface using XUI. But what about the accumulated experience in classic B4A? In my situation, this will lead to a decrease in productivity. In addition, the problem of adapting examples written for classic B4A will still remain. What would you advise me, colleagues?
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
I would advice you to try new features in B4A.
There are so much better things you can do if you leave the legacy way.
By the way, many features are not new. B4A has evolved a lot since the release of XUI, XUI View, B4XPages and more.
 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
I think you missed out on B4XPages and XUI Views. Kindly revisit it.

1. XUI and XUI Views are made to be cross platform compatible
Means Instead of Adding Label In B4A, and another Label in B4i or B4J, You add it as B4XView

Check the XUI Views Thread for to see the list of views https://www.b4x.com/android/forum/t...ss-platform-views-and-dialogs.100836/#content

2. Use B4XPages which is has done 95% of heaving lifting across platforms (B4A, B4i, B4J). With just a little tweak, you can have an app running on B4A and B4i or B4J within few minutes.

Note: The UI have to be manually copied between platforms, but it is easy if all the Views you use are from XUI Views

 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I can see were you want to go with your comment but you are expressing it rather poorly.
B4A targets Android devices, B4i targets iOS devices, and B4J targets Java able devices...
The code produce in either of these 3 platforms is 80% to 90% reusable across the other platforms... so why not 100% (this is what you are indeed questioning)
Well, Android has views/controls that are non-existing in Android or Java enabled devices, and the same is true for any of the remaining 2 platforms.
Eventually, a unified IDE will be in the next evolutionary steps of B4X, but that will not exclude the need for the programmer to adapt the code for the targeted device;
Plus, due to the fact that the targeted hardware is in constant evolution, and so is the underlying OS (one pushes the other to evolve) B4X tries to keep up with those changements, and sometimes, as we see with B4A, even stays one step ahead of the upcoming requirements, so that developers can adapt before it becomes mandatory.

So, to answer you question.... Using B4X, and B4XViews ans much as possible, you will have a code base that will be reusable nearly 90% by any of the B4X suite IDE's BUT, there are specificities that, at least for now, prevent the use of a single IDE to create code to all platforms....

There is, however, one particular feature that passes by almost unnoticed... you can use code blocks targeting any other IDE from your current IDE, by using the #if blocks.
like if you are coding in B4J and you put...

#If B4A
'put B4A code here
#end if

#If B4i
' put B4I code here
#end if

Your code will still be compiled for Java enabled devices, but the #if B4... block will not be parsed... but this will allow you to keep a single "master platform" code file, and still have IDE specific code in it
 
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
The best and most accurate answer. I was especially pleased by the hope that a more universal version could still be created. For example, sometimes you can sacrifice functionality in exchange for maximum ease of adaptation to any platform. Well, and narrowly tailored versions for a specific platform will of course always be in demand. Thanks for the professional answer.
 
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
You are absolutely right, I want to clarify right away that you can use XUI capabilities without a designer. I am used to customizing each interface element programmatically.
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
You are absolutely right, I want to clarify right away that you can use XUI capabilities without a designer. I am used to customizing each interface element programmatically.

Some time ago (that is about 6 years) when I started programming in B4i I noticed some differences in specific tasks so I overcame it by creating classes that wrapped the way B4i operates and exposed a B4A similar interface. F.e. I created a PhoneWakeState class which exposed the same interface as B4A. At the end I was using the exact interface of B4A with just an initialization more.
 
Upvote 0

Cadenzo

Active Member
Licensed User
Longtime User
so I overcame it by creating classes that wrapped the way B4i operates and exposed a B4A similar interface.
That's exactly what I do and for me it is really a comfortable way, to write for B4A and B4i. Most classes I put into parent folder, global for both OS. But at least one class I use different file for B4A and B4i, just to prevent this "#if"-areas. Different file - same name - same methods - different implementations.

I would be glad, if there would be an code snippet collection for this thinks, that need different implementation. I started a little one here.
 
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
I make applications that could be useful to me and other people. Everything I do does not have commercial success Therefore, creating my applications is my hobby in my free time from my main job.
 
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
I am glad that the topic I touched on worries many. I wonder what percentage of programmers use the constructor in their applications? In addition, it is interesting to know which mobile devices are most in demand for programming: iPhone or Android
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
which mobile devices are most in demand for programming: iPhone or Android
That's like comparing Ferrari to Lamborghini!!! It's a volatile opinion thing.... passion if you want to call it that way
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…