iOS Question B4X-B4XPages first app

luke2012

Well-Known Member
Licensed User
Longtime User
Hi all,
I'm implementing my first app using B4XPages (by @Erel) and I started developing the B4A version and the final goal is to have the Android version and the iOS version of this app.
Within the project path, when I open the B4i version I see that several modules are missing compared to the B4A version, I expected to find all modules or most compatible ones (see attached file).
Am I doing something wrong?

Thanks in advance for your help / reply.
Luca.
 

Attachments

  • b4a_b4i_modules.png
    93.5 KB · Views: 117

luke2012

Well-Known Member
Licensed User
Longtime User
You need to add the modules in the B4i IDE with Project / Add existing Module with a relative link.
Thanks for your reply @klaus.
Just out of curiosity, but the alignment of the modules (between B4A and B4i) is not done automatically for some technical reason?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Just out of curiosity, but the alignment of the modules (between B4A and B4i) is not done automatically for some technical reason?
Sorry, I do not understand your question.
What do you mean with: the alignment ?
The IDEs are different for each platform and you need to add new modules.

Did you have a look at the B4X Pages Cross-platform projects booklet ?
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
To be clear.
To add a new B4XPage you must add it in one of the IDEs.



Do not forget to check .



Then, in the other platform IDEs you need to add the new Page.



And select .



After this, when you make any change in the code in one of the IDEs save the project and the module code will automatically be updated in the other platform IDEs.
 

Attachments

  • 1632985487420.png
    1.1 KB · Views: 98
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User

Thanks to all for your replies.
So, each time I add a new B4XPage I have to be sure that the "Add module to the parent folder" is checked, in order to share and link between all 3 platforms. I got it

@klaus first of all, thanks for your explanation.
With "the alignment", i mean what @aeric said "It will appear/sync to all 3 platforms automatically" (not manual linking).

About B4XPages modules, is the "B4XMainPage" module (.bas file) exactly the same for all 3 platforms (B4i, B4A and B4J)?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
About B4XPages modules, is the "B4XMainPage" module (.bas file) exactly the same for all 3 platforms (B4i, B4A and B4J)?
Yes, there is only one file in the project folder.
For all other modules with a relative link it is the same.
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
First of all, thanks for your help @klaus @aeric.
Now I imported (linked) all the modules (shared within B4A and B4i), but I have a little compilation problem (within B4i) about this code:

B4X:
Sub Class_Globals
       Dim wve As WebViewExtras
       Dim jsi As DefaultJavascriptInterface
'......
End Sub

Private Sub CreateItem (cfv As CardFullValue) As B4XView
    'WebView autoresize
    #if B4A
        wve.Initialize(wvCardDesc)
        jsi.Initialize
        wve.AddJavascriptInterface(jsi,"B4A")
        wvCardDesc.LoadHtml(cfv.Desc)
    #End If
    #if B4i
        private htmlHead as string = $"<head><meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'/></head>
        private htmlDesc as string = cfv.Desc
        wvCardDesc.LoadHtml(htmlHead & htmlDesc)
    #End If

'......
end sub

I got this B4i errors:
"Unknown type: webviewextras<br />Are you missing a library reference?"
"Unknown type: defaultjavascriptinterface<br />Are you missing a library reference?"

I cannot find a library called "Webview / WebviewExtras" within B4i Libraries tab.
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
Try:

B4X:
#if B4A
Dim wve As WebViewExtras
#End If

Hi @aeric.
Since it's my first B4XPages App, your suggestions are helping me a lot.
You are very close to getting coffee from me

Now I should get the project files for the B4A and B4i version to work correctly.
I started to develop the app with B4A and now I find all the files (mainly image type) under the "B4A / Files" folder and I should integrate them and make them work also inside the B4i app.

In this case what are the correct steps to take to make everything work correctly?

1) Do I move (manually) all the files (in this case image) into the parent folder of the "Shared Files" project?
2) Then I import / create a link (to understand how exactly) within the two IDEs B4A and B4i?

Thanks in advance for your help.

Luca.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Hi Luca,
I may also not follow the correct way as what I usually do is copy the “assets” files to it’s own platform which created redundant copies. I got a warning from the IDE previously that an icon file for B4J is not used in shared folder and I think I am doing it wrong. I think other members can advise on this. As for me, I am trying to avoid putting any files into the shared files folder. There are way to use an ‘ignore comment to suppress the warning.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
All common files should be in the Shared Files folder of the project.
These files are automatically copied by the IDE in the platform specific Files folder.
This line on top of the B4XMainPage module does it:
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"

If you change any of the files, always change them in the Shared Files folder.
 
Upvote 1

luke2012

Well-Known Member
Licensed User
Longtime User
With "All common files should be in the Shared Files folder", you mean all files except for .bas, .bal and .bil files. Correct ?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Yes.
All .bas files must be in the project folder at the same level as the B4XainPage.bas file.
All layout files must be in the platform specific Files folder.
All other files should be in the project Shared Files folder.
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
Yes.
All .bas files must be in the project folder at the same level as the B4XainPage.bas file.
All layout files must be in the platform specific Files folder.
All other files should be in the project Shared Files folder.
Perfect. Now I fixed all files position
Talking about layout file, The only way to do a porting between (B4A and B4i) is to create (manually) each layout within B4i ide and manually copy each layout content from B4A to B4i. Correct ?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
@Shelby
I suppose that the red lines in the Logs are:
Unexpected event (missing RaiseSynchronousEvents): sv2_scrollchanged
Check the unfiltered logs for the full stack trace.

Do not bother about those, they are harmful. I had posted this in the Forum and that was Erel's answer.

The vertical cursor allows you to scroll very fast over the entire list without scrolling and scrolling many times with the finger to get near or at the end.
If you do not like it and do not want it you can uncheck the property FastScroll in the Designer.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…