iOS Question Convert B4A in B4I

Giusy

Active Member
Licensed User
Hi,
I have to convert my program B4A in B4I.
how should I change the commands

StartActivity("mainpro")
Activity.finish

Thanks
 

Star-Dust

Expert
Licensed User
Longtime User
@Giusy from the little I know of B4i I can tell you that IOS does not work like Android.
The App is not divided into different activities.
You must use only one activity and possibly split into separate pages. Each Page can contain multiple panels.

Even if you might think about associating an Activity with the page, it's actually not the same thing at least for writing the code.
The code will reside entirely on the Main or code modules.
In android the code of each activity is in the module of the same activity, while in IOS all the code related to the various pages must be in the Main or in the code modules.

To load a new page use this command:
B4X:
NavControl.ShowPage(PageNew)

you can load the Layou on the page with this command:
B4X:
PageNew.Initialize("page2")
PageNew.RootPanel.LoadLayout ('LayoutNew')
 
Last edited:
Upvote 0

Giusy

Active Member
Licensed User
@Star-Dust,
I feel like crying :(
If in B4A I have an activity with many buttons (like a menu) and an other activity with the development of choices,
indicatively how I translate it?
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I started writing for ios for a week and I'm rewriting everything.
Although some parts as functions and methods can be copied in full, what concerns the UI must be rewritten.
Luckily I have used the Activities in my Apps a little, but I have used different Panels for the different parts of the App. So I will continue in this direction

Now I'm designing the new Apps in such a way that it requires little translation between the various platforms and possibly using the XUI library.

Do well to cry :p
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Unfortunately, you need to change your mind.
Even Google with Android changed it's mind since the different versions.
Now, even in B4A, using different Panels instead of Activities becomes more used.
I am sure that XUI will be an answer in the future.
But it will need, in my opinion, some time to become mature, because the operating systems are diiferent, there are same views but there are also different views, and at least but not last the feeling of the users, about user interfaces, are not the same in the different oprerating systems.
 
Last edited:
Upvote 0

Giusy

Active Member
Licensed User
@Star-Dust thanks for the encouragement ahahahahah
thank you all
I found something interesting from Erel (which I enclose)
 

Attachments

  • ThreePages.zip
    7 KB · Views: 198
Upvote 0
D

Deleted member 103

Guest
@Giusy
I always try to realize the following conversion:
B4a -> B4i
Starter-Service -> Code-module
Activity -> Page
Code-module -> Code-module
frmMain.bal -> frmMain.bil

In this way, I no longer have to re-develop the app.
Converting an activity to a B4i panel would work as well, but, in my opinion, is not a professional programming.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
Converting an activity to a B4i panel would work as well, but, in my opinion, is not a professional programming.

why not?

it looks the same to the end-user (on Android even better since you don't have these stupid activity delays and animations)
and it's a lot easier to deal with as you stay in the same main activity and use classes.

all my games use this method and porting an android app to IOS is a matter of maybe an hour of fiddling and testing.
(mainly font and gravitiy differences and that's about it)

it ofcourse depends on the type of app.
 
Upvote 0

Carlos marin

Active Member
Licensed User
Longtime User
Hello a few days ago I acquired the license for b4i, I'm going through all my program of b4a and I'm doing great, I really appreciate this tool I do not have to work on a mac and almost all the b4a code is received by the b4i. what worries me is having so many pages and not being able to finish them that will not fill the memory?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
what worries me is having so many pages and not being able to finish them that will not fill the memory?
You should always start a new thread for your questions.

I would have started with the most simple implementation possible. If you do see a memory error then you should investigate it and find its cause. It is possible to remove pages by removing them from the NavControl.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
I don't see how the above post is related. It is much simpler to go from B4A to B4i than to rewrite it with Xcode. If you are using XUI then you can actually share the same modules between the projects.
I wasn't suggesting that the app be rewritten in Xcode. I figured that if B4i generates code that is compiled in Xcode, it might be useful to get a better understanding of how iOS apps compare to Android apps.

Having said that, rewriting B4A apps in Swift is actually pretty easy.
 
Upvote 0
Top