2501
July 5, 2019, 2:35pm
1
Hi, Im new to Android Studio and I tried to load a basic babylonJS scene using the WebView control available in Android Studio, I saw that it loads regular websites with no problem but is not loading the babylon 3d scene.
How can I show a babylon scene (from an external url) in my Android Studio app?
Just in case I’m using this scene to test:
http://wilawara.000webhostapp.com/demos/appareldemo/
Thank you all.
Could you try following those steps:
WebGL Native Andriod App , Three.js Development,Android Application, WebGL Android WebView,WebGL Viewer for CAD Models, Mobile Solution for Construction
I recall Javascript is not enabled by default (not sure if it is still the case)
Something like that should work:
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);
webSettings.setDatabaseEnabled(true);
webSettings.setAllowFileAccess(true);
webSettings.setAllowFileAccessFromFileURLs(true);
webSettings.setAllowUniversalAccessFromFileURLs(true);
webSettings.setMediaPlaybackRequiresUserGesture(false);
2501
July 5, 2019, 2:57pm
4
wow, thank you both for your fast assistance. I’ll try the suggestions and let you know.
2 Likes
2501
July 5, 2019, 9:17pm
5
Adding the line:
webView.getSettings().setJavascriptEnabled(true);
Solved the issue and now I can use my babylon scene
Thank you very much
1 Like