Android Question B4XPages - shared project modules

LucaMs

Expert
Licensed User
Longtime User
I posted a simple B4XPages example for an our friend. From within the environment I also created a second B4XPage, by ticking the CheckBox: "Add to parent folder". All is ok, the class is creted and saved at the same directory level as the B4XMainPage.

In the project I also imported (checked) a library of type .b4xlib.

When the friend opened the project in his B4i both the class and the library were not imported.

I suppose the library is not automatically checked because it may not be needed in the B4i project (although it is a b4xlib) but why is the class not loaded? The IDE could/should load the .bas files it finds at that directory level, or not?
 

luke2012

Well-Known Member
Licensed User
Longtime User
I posted a simple B4XPages example for an our friend. From within the environment I also created a second B4XPage, by ticking the CheckBox: "Add to parent folder". All is ok, the class is creted and saved at the same directory level as the B4XMainPage.

In the project I also imported (checked) a library of type .b4xlib.

When the friend opened the project in his B4i both the class and the library were not imported.

I suppose the library is not automatically checked because it may not be needed in the B4i project (although it is a b4xlib) but why is the class not loaded? The IDE could/should load the .bas files it finds at that directory level, or not?

I'm the friend (I suppose) :)
Another example is my B4XPages project. I started creating it with the File / New / B4XPages template created by @Erel .

Project (parent folder):
Schermata 2021-01-09 alle 17.02.01.png


Project opened in B4A and B4i (tab "modules"):

Schermata 2021-01-09 alle 17.20.38.png


All the B4XPages classes (that are the shared cross-platform classes) are not present within the B4i version.
Note: I'm using B4A v.10.50 and B4i v.6.80.
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
I am not sure I understand exactly the problem, but.

When you create a new B4XPages project you get the structure for all three platforms.
- The B4XMainPage.bas module is common to all platforms and loaded automatically.
- Any other module, B4XPage module or any other class module, must be added by hand in the other platforms, they are not added automatically, eventhough they are in the project folder.
- Libraries are checked automatically if they are found by the IDE.

When the friend opened the project in his B4i both the class and the library were not imported.
The second page will not be added automatically.
But, the b4xlib should be checked!
If it is not the case, this means that the IDE did not find it, probably not saved at the right place.

Then I see a lot of bas modules, are these or some of these supposed to be b4xlibs ?
If yes, the modules must not be in the project folder and not shown as modules in the IDE.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
I am not sure I understand exactly the problem, but.
- The B4XMainPage.bas module is common to all platforms and loaded automatically.
- Any other module, B4XPage module or any other class module, must be added by hand in the other platforms, they are not added automatically, eventhough they are in the project folder.
And this is one "problem" ("Wish"?); why only B4XMainPage.bas given that if i created the others voluntary in the project folder because they have to be shared between platforms? All .bas in the project folder should be loaded automatically.
I believe that the IDE loads only what it finds written in the main project file (that is the files with the extension .b4a, .b4j, .b4i). If I create a B4A project, obviously the corresponding .b4j file is not modified and therefore when I open the B4J project that files are not loaded. It would be useful that the IDE "look" in the project folder and load all the .bas regardless of what is written in the .b4j or that this file was also updated from within the B4A environment (in this example case).

- Libraries are checked automatically if they are found by the IDE.
No, and I think for the same reason: the "other" project file will not be updated, it will be just the template file.
I tried (again) now, creating a B4A project, selected the XUI Views library, saved, opened the B4J project and the library (found) was not "checked" (selected-imported).
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You will need to add the modules and the libraries to the other projects. Many of the libraries are not cross platform so it makes sense.

The IDE doesn't treat any folder in a special way. The project structure is just a convention.
It is a valid request to make a default project folder where modules will be loaded automatically.
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
nice project, at least so it seems, from the file list, it would be nice to share it.
😁😁😁

In other case I can share but unfortunately not in this case because it's for my customer. He is the owner in this case :)
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
You will need to add the modules and the libraries to the other projects. Many of the libraries are not cross platform so it makes sense.

The IDE doesn't treat any folder in a special way. The project structure is just a convention.
It is a valid request to make a default project folder where modules will be loaded automatically.

Yes @Erel. As you known more than me the main target of the B4X Tools is to simplify and reduce the waist of time for things that can be done automatically by the IDE's.
For Example, in my project (#2) there are 4/5 B4XPages classes.
So in this kind of B4X (B4XPages) projects I have to waste time to add one by one the B4XPages classes for B4i and B4J.

"The IDE doesn't treat any folder in a special way. The project structure is just a convention."
I understood it but the target (of the B4X Tools and framework) is to simplify and optimize the dev time for cross-platform projects. Do you agree ? :)

"It is a valid request to make a default project folder where modules will be loaded automatically."
Yes, I agree.

Thanks for your replies @Erel and @klaus.
 
Upvote 0
Top