Android Question Are there mini sample projects to illustrate the views etc in typical apps?

fikayo

Member
I came across b4x just a few days ago and have been trying to see how it works. Very impressed, I must say.
However, it seems much of the beautiful documentation is about "trees" (layouts, viewd, modules, libraries, etc) At this stage I would really appreciate "mini forrests) i.e. working app examples that illustrate how the different trees work together under different real-life type of apps. I really benefitted from the ThreePagesProject example, but how about something showing rudimentary app incorporating titlebar, menubar, toolbar, statusbar, sidebar etc. The interconnections among all these in code will hasten understanding and make b4x even more RAD.
 

MicroDrie

Well-Known Member
Licensed User
I really benefitted from the ThreePagesProject example, but how about something showing rudimentary app incorporating titlebar, menubar, toolbar, statusbar, sidebar etc. The interconnections among all these in code will hasten understanding and make b4x even more RAD.
I always start with the ThreePagesProject and add extra functionality to it. The multiplatform B4X was added later. What you see a lot is that people at B4XPages don't realize that if you initialize the program in B4XMainPage by bringing specific program functionality into specific B4XPages, you can reuse those specific B4XPages very easily. You should therefore not put any functions in the B4XMainPage other than initializing the B4XPages to facilitate easy code reuse. Usually it is very easy to transfer found solutions from B4A to B4X and you only have to pay some attention to the initialization and shutdown routines. Good luck with programming in B4X.
 
Upvote 0

fikayo

Member
I always start with the ThreePagesProject and add extra functionality to it. The multiplatform B4X was added later. What you see a lot is that people at B4XPages don't realize that if you initialize the program in B4XMainPage by bringing specific program functionality into specific B4XPages, you can reuse those specific B4XPages very easily. You should therefore not put any functions in the B4XMainPage other than initializing the B4XPages to facilitate easy code reuse. Usually it is very easy to transfer found solutions from B4A to B4X and you only have to pay some attention to the initialization and shutdown routines. Good luck with programming in B4X.
Thank you for these great tips. I especially like, "You should therefore not put any functions in the B4XMainPage other than initializing the B4XPages to facilitate easy code reuse." which will definitely make the projects cleaner and easier to manage.
 
Upvote 0

fikayo

Member
Upvote 0

MicroDrie

Well-Known Member
Licensed User
The only problem I am having now is sorting out the functionalities of the different libraries.
First your second question:
I'm getting many red errors saying I missed some libraries. Is there a quick reference material to introduce the major/common libraries and what functionalities they expose?

When I started I had the same problem and found this trick:
  1. Unzip the program file
  2. Go to the B4J or B4A directory
  3. Open the program file with the extension b4j or b4a with notepad or notepad++
  4. Find the lines that start with the text LibraryX. where x stands for the counter of the number of libraries that exist.
    1648562679790.png

  5. Select the name of the library so Library23=jgameviewhelper => jgameviewhelper
  6. Paste the selected library name into a search box in a forum page and hit enter key. You will see a list of results:
    1648563484779.png
  7. Usually you will find the library you are looking for in the first search result and you will find the answer to your other question (from) there:
The only problem I am having now is sorting out the functionalities of the different libraries.
Update1: List result explained more in detail.
Update2: I'll start with an unzipped version because only the very first time it will show which libraries are missing!
 
Last edited:
Upvote 0
Top