Android Question B4X Page means B4A Activity Module?

Nitin Joshi

Active Member
Licensed User
I have started to learn B4X pages for cross platform support. Looks interesting. Based on my reading till now, my understanding is B4A pages means similar like Activity Modules of B4A

Is my understanding correct?
 

Nitin Joshi

Active Member
Licensed User
Thanks Erel,
If i develop APP in B4A using B4X pages then I do not need to put efforts for B4i development? Just need to make design files for B4i?
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
For the layout, we can copy and paste. Maybe some views which are platform specific need to be added manually. So the better approach is try to use B4X cross platform views.
For the code, you can use conditional compiling for platform specific code.
Here is my example:
B4X:
Sub Class_Globals
    Private Root As B4XView 'ignore
    Private xui As XUI 'ignore
    #If B4i
    Dim hud As HUD
    #End If
    #If B4J
    Dim clx As clXToastMessage1
    Private fx As JFX   
    #End If   
    Private CLV As CustomListView
    Private LblTopic As Label
    Private LblShortDesc As Label
    Private LblResult As Label   
    #If B4J
    Private PnlTopic As Pane   
    #Else
    Private PnlTopic As Panel
    #End If
End Sub
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
I believe that B4XPages is a well-thought-out project (I am even convinced that it is) ... But there are many questions. By creating multiple pages, we create a lot of variables that are never killed and eat up memory resources on the device ... Another thing is that when you close your normal Activities, some of these resources are released ... What is the impact of using B4XPages on stack and is battery consumption greater?
 
Last edited:
Upvote 0

aeric

Expert
Licensed User
Longtime User
I believe that B4XPages is a well-thought-out project (I am even convinced that it is) ... But there are many questions. By creating multiple pages, we create a lot of variables that are never killed and eat up memory resources on the device ... Another thing is that when you close your normal Activities, some of these resources are released ... What is the impact of using B4XPages on stack and is battery consumption greater?
If I understand correctly, in B4A case, using B4XPages will reduce number of Activity thus use up less resources.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
If I understand correctly, in B4A case, using B4XPages will reduce number of Activity thus use up less resources.
B4XPages simplifies a lot of things, for example using this unfortunate CallSubDelayed ... We just need to learn a different approach to program development ...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I believe that B4XPages is a well-thought-out project (I am even convinced that it is) ... But there are many questions. By creating multiple pages, we create a lot of variables that are never killed and eat up memory resources on the device ... Another thing is that when you close your normal Activities, some of these resources are released ... What is the impact of using B4XPages on stack and is battery consumption greater?
With the exception of orientation changes, everything else is better with B4XPages including performance and memory footprint. The pages are lightweight and thanks to the simpler model, if there is indeed a need to remove views then it is much easier to implement it with B4XPages compared to the standard activities.
 
Upvote 0

Nitin Joshi

Active Member
Licensed User
Hi Erel,
My question has two parts....
Part 1
I would like to know the syntax used in B4X Pages. I mean, syntax is similar like used in B4A activity module, I mean syntax used inside activity related subs likes..."Activity_Create", "Activity_Pause", "Actiivty_Resume", etc.... ?

Part 2
My understanding is...
In B4A project, subs inside activity modules can be categorized in two as below...
1) Default Subs which are related to Activity (Activity_Create, Activity_Pause, Activity_Resume,...) and
2) User created Subs, it can be controls related (B1_Click) or manually added.

Now, I want to remove B4A activity module and want to add B4X page in my current B4A project, so, For category 1, Inside B4X page (instead of Activity Module) need to follow B4X syntax and category 2 just need to copy and paste from B4A activity module.

Is my understanding correct?
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
Hi Nitin, You will be asked to start a new question/thread/post. Using an existing thread to launch your query is frowned upon here in this forum.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Nitin Joshi

Active Member
Licensed User
Thanks Erel, Actually, i have not started to migrate my APP in B4X pages. I am currently scared, seems difficult than B4A. At the same time, i can understand unless and until i do not start i will not realize.
 
Upvote 0
Top