Android Question weird behavior with b4a designer

ilan

Expert
Licensed User

this happens after working a about 1-2 hours on b4a. if i close b4a and open again everything works fine for about 1 to 2 hour then it happens again. the ide also starts to react very slow until everything freezes. restarting b4a fix the issue but it happens again. i need to mention that its a big project but i am not sure its because of that.
 

Erel

Administrator
Staff member
Licensed User
Why are you building the layout like this? It is wrong.

Split it into several layout files. This will allow you to use anchors and other features. It will also make the program more responsive. There is no reason to load all the views when the program starts.
 

ilan

Expert
Licensed User
Why are you building the layout like this? It is wrong.

Split it into several layout files. This will allow you to use anchors and other features. It will also make the program more responsive. There is no reason to load all the views when the program starts.
I have about 8 layout files. Each layout files is a window in my app. There is the settings window, the main window,...

I cannot load a part of the views since i need them when entering that section in my app. It is a very complex and big app.

I dont like to use anchors they dont always react as expected.
 

Erel

Administrator
Staff member
Licensed User
I dont like to use anchors they dont always react as expected.
Never seen such a case. If you encounter one then you should report it.

I cannot load a part of the views since i need them when entering that section in my app. It is a very complex and big app.
The more complex the layout the more it makes sense to split it into several files. You can load them one after another if you like.
 

Erel

Administrator
Staff member
Licensed User
I never encountered such issue so hard to say based on the video. I do assume that if you split the layout it will not happen and if it will happen it will be easier to say what causes it.
 

techknight

Well-Known Member
Licensed User
Its almost certainly a classic sign of a memory leak. Since your project is so huge, your probably running into it whereas normally it wouldnt happen.
 

Kwame Twum

Active Member
Licensed User
Never seen such a case. If you encounter one then you should report it.
When you use anchors on views in a panel, they work fine. But when you load this panel in a scrollview at runtime, the anchors don't work. At least not for me.
Usually, I put the scrollview and then panel in the same layout file.

Then at runtime, I use:

B4X:
panel.RemoveView
scrollview.Panel.AddView(panel, ...)
After this, the panel's views lose their anchor properties. I'm guessing the RemoveView resets the anchors... maybe I'm wrong.:rolleyes:
 

kisoft

Well-Known Member
Licensed User
You better listen to Erel's advice and divide it into several smaller layout files. You can display the selected view at any time. . This will be a much safer solution for your application...This my previous advice about the stack may also be helpful for you. Especially when you stay with your old solution.
 

Kwame Twum

Active Member
Licensed User
You better listen to Erel's advice and divide it into several smaller layout files. You can display the selected view at any time. . This will be a much safer solution for your application...This my previous advice about the stack may also be helpful for you. Especially when you stay with your old solution.
Erel's advice is well taken... I was just giving a scenario where anchors will fail :)
 

Erel

Administrator
Staff member
Licensed User
When you use anchors on views in a panel, they work fine. But when you load this panel in a scrollview at runtime, the anchors don't work. At least not for me.
Usually, I put the scrollview and then panel in the same layout file.
1. You should probably use xCustomListView instead of ScrollView.
2. Anchors are only applied once when the layout is loaded. If you later resize the view then they will not have any effect.
 

ilan

Expert
Licensed User
I never encountered such issue so hard to say based on the video. I do assume that if you split the layout it will not happen and if it will happen it will be easier to say what causes it.
i dont know why it happens but after a while working on b4a (about 1h) the issue is still happening even on very small layout files (maybe 20 views)
the ide also start running slow. what i mean is that i type a code and it is writing after few seconds i have finished typing. so a delay of about 2-3 seconds.
the problem is that it happens often lately. i need to mention that i have a very strong (and new) notebook! i accounter those issue since the last update (v9.3)

ps b4a is using about 2,2gb ram and when it compiles about 100% of processor is this normal? i also see that b4a is 32 bit. is there a 64 bit? will it perform better on windows 10 (a 64 bit version)?

is there something i can do to run b4a smooth again?

thanx, ilan

EDIT: after restarting b4a it even happens after few minutes now :(
 
Last edited:

Erel

Administrator
Staff member
Licensed User
There is currently no 64 bit version of B4A, it won't make a significant difference.
Try to find what causes it. Does it happen when the external device (WYSIWYG device) is not connected to the designer?
 

ilan

Expert
Licensed User
There is currently no 64 bit version of B4A, it won't make a significant difference.
Try to find what causes it. Does it happen when the external device (WYSIWYG device) is not connected to the designer?
acctually it happens when the external device (WYSIWYG device) is connected. if i work with simulator i dont ancounter this. at least as i remember it happen if i use an external device that is connected via usb.

btw. i dont have such issue with b4j and b4i so i dont think it is a problem with my pc.
 

Erel

Administrator
Staff member
Licensed User
acctually it happens when the external device (WYSIWYG device) is connected
This is what I thought. For some reason you encounter a race condition between the device state and the IDE state. Disconnect the device when it happens (Shift + F2) and see whether it solves it.
 
Top