Android Question weird behavior with b4a designer

Discussion in 'Android Questions' started by ilan, Jul 17, 2019.

  1. ilan

    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.
     
    MarkusR likes this.
  2. Erel

    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.
     
  3. ilan

    ilan Expert Licensed User

    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.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Never seen such a case. If you encounter one then you should report it.

    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.
     
    KMatle likes this.
  5. ilan

    ilan Expert Licensed User

    Ok i understand, so you think its because the layout file is huge?
     
  6. Erel

    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.
     
  7. techknight

    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.
     
  8. kisoft

    kisoft Active Member Licensed User

  9. ilan

    ilan Expert Licensed User

  10. kisoft

    kisoft Active Member Licensed User

    I'm sorry I misunderstood
     
  11. Kwame Twum

    Kwame Twum Active 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.

    Then at runtime, I use:

    Code:
    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:
     
  12. kisoft

    kisoft 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.
     
  13. Kwame Twum

    Kwame Twum Active Member Licensed User

    Erel's advice is well taken... I was just giving a scenario where anchors will fail :)
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    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.
     
    Kwame Twum likes this.
  15. ilan

    ilan Expert Licensed User

    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: Jul 31, 2019
  16. Erel

    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?
     
  17. ilan

    ilan Expert Licensed User

    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.
     
  18. Erel

    Erel Administrator Staff Member Licensed User

    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.
     
    ilan likes this.
  19. ilan

    ilan Expert Licensed User

    Ok thank you i will try it next time and tell you if it helped me.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice