iOS Question Best Practise, Potholes, Loopholes and Lessons to learn when Converting a b4a app to b4i?

Mashiane

Expert
Licensed User
Longtime User
Hi there

Well, its been a couple of days after a long time b4i not-programming and I have been trying b4x cross platform. Not easy but doable. I think it would be awesome to get some knowledge into best practise in ensuring one writes apps that can work seamlessly between b4a and b4i. Yes its different systems altogether, however there should be a 0% less painful experience in doing this.

Well I'm enjoying it, but the challenge is having to find the best answer from the forum search. There is just too much information flow, old posts and new posts doing the same thing differently. I guess the "mark answer as best" answer feature will help a great deal into ensuring a great experience.

As an example, what not to use in your b4a app as it wont work in b4i, I thought just now. As an example, getValueAt and getKeyAt are a no-no in b4i, whilst use with joy in the b4a world. These differences are crucial for anyone to understand both of these worlds.

Perhaps in a long format, as an example I opened b4i and b4a at the same time, went to the libraries listing and checked all the libs that I could find it b4i which matched my b4a app equivalents. I haven't explored b4xpages enough to know whether this is automatic or not process when creating cross platform apps. So I checked all the libraries I needed. Then came the coding, I think in one or two instances I found out that the method names were not the same between b4a and b4i on the same android and iOS version of the lib, anyway thats not an issue to take home about,

Is there something like this where one can just go and get the best advise on how to ensure the process of building a b4i app from a b4a app is smooth and a beautiful experience, yes it will have challenges like everything else.

#justAthought.
 

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
Then came the coding, I think in one or two instances I found out that the method names were not the same between b4a and b4i on the same android and iOS version of the lib,

I would say that using B4XViews goes a long way to creating a consistent interface between the 2 languages. Most of my development now is for both Android and iOS.

Using b4xpages, I find that I alternate between using the B4i and the B4A environment for primary coding. That way I can pick up on any variances. as I go.

The most noticeable one for me is the default font size difference on layouts when copying.

The final gotcha for me was CSBuilder strings which I used to use extensively. I have now migrated to using BCTextEngine and BBLabels which are Cross platform.

I recently has to convert a B4a/B4i app to B4j and the hardest part was copying over all of the layouts, plus dealing with some CSS styling oddities. (highlight borders on clvs for example)
 
Upvote 1

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top