iOS Question WebView in iOS....

eps

Well-Known Member
Licensed User
I've developed a few small Apps in B4A, but I'm conscious that I need to place them on iOS as well...

I'm working towards a game, with HTML5, Javascript and using Babylon.js

Has anyone converted a WebView from B4A? If so can they let me know if they have been able to successfully convert the following code or point me in the right direction of getting the relevant libraries in place or a possible starting place please?

I've seen this thread,

https://www.b4x.com/android/forum/threads/webview-extra.48304/

which seems to suggest that the libraries I'm interested in aren't yet available but I'm just wondering if anyone had worked through the problems already?

My code is :

B4X:
'Do not forget to load the layout file created with the visual designer. For example:

    'Activity.LoadLayout("Layout1")

    wv.Initialize("wv")

  

    wve.addWebChromeClient(wv,"wve")

    wvs.setAllowFileAccess(wv,True)

    wvs.setAppCacheEnabled(wv,True)

    wvs.setDOMStorageEnabled(wv,True)

    wvs.setDisplayZoomControls(wv,False)



    Activity.AddView(wv,0,0,100%x,100%y)

    wv.LoadUrl("file:///android_asset/index.html")

   ime1.Initialize("ime1")

   ime1.AddHeightChangedEvent

   Dim jo As JavaObject = Activity

   jo.RunMethodJO("getContext", Null).RunMethodJO("getWindow", Null).RunMethod("setSoftInputMode", _

    Array As Object(0x20))

    ActivityParent = jo.RunMethodJO("getParent", Null)
Which uses WebViewExtras and WebViewSettings... I'm up for converting the libraries if needed, but it would be my first time wrapping a library! I guess its something I need to do!!

My whole reason for developing in HTML5 and Babylon.js was to enable the code to work on multiple platforms as easily as possible...! Now I'm not so sure....

MTIA
 

Erel

Administrator
Staff member
Licensed User
My whole reason for developing in HTML5 and Babylon.js was to enable the code to work on multiple platforms as easily as possible...!
1. This is not the correct way to develop with B4X. Watch the XUI video tutorials.

2. Which features are you missing?

3. Check XUI.FileUri for a better way to load assets resources.
 

eps

Well-Known Member
Licensed User
1. This is not the correct way to develop with B4X. Watch the XUI video tutorials.

2. Which features are you missing?

3. Check XUI.FileUri for a better way to load assets resources.
Ah yes - sorry! I should point out, for the over-riding majority of my projects they are developed in B4A. This project is a brand new one, a web based game in 3D, therefore I thought the best way forward for that, certainly in terms of portability was to develop using HTML5 and Javascript - as this is what Babylon.js is written in and it works really well (it's the 3D gaming version of B4A - it does what it says it does and it does it well!)
 

eps

Well-Known Member
Licensed User
Hi @Erel (or anyone else!)

So just to make sure... So based on my extra information above about producing a 3D game and using Babylon.js am I right in thinking that a WebView is the best way forward with this or would you still recommend XUI? It seems to be mostly for 2D games, but maybe I just missed something or misunderstood something?

Thanks!
 
Top