Hello,
I have looked through the WebViewExtras library and i still cant make my code work...
What im trying to do is call a function or variable from B4A that would return me some value from the webview's javascript.
Here's a modified version of the code i have:
I know this code is missing something regarding getting the value back, and i think thats where i am clueless. Any help would be greatly appreciated...
Y.
I have looked through the WebViewExtras library and i still cant make my code work...
What im trying to do is call a function or variable from B4A that would return me some value from the webview's javascript.
Here's a modified version of the code i have:
B4X:
pnlDemoVideo.Initialize("")
pnlDemoVideo.Color= Colors.White
Activity.AddView(pnlDemoVideo,0,0,Activity.Width,Activity.Height)
'Initializing webview and setting permission for camera usage
wv_Tele.Initialize("wvTele")
'Verifying permission and setting the WebViewExtra object.
rp.CheckAndRequest(rp.PERMISSION_CAMERA)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
Dim client As JavaObject
client.InitializeNewInstance(Application.PackageName & ".main$MyChromeClient", Null)
Dim jo As JavaObject = wv_Tele
jo.RunMethod("setWebChromeClient", Array(client))
CamViewExtras.Initialize(wv_Tele)
CamViewExtras.LoadUrl(TeleUrl)
CamViewExtras.JavaScriptEnabled = True
CamViewExtras.AddJavascriptInterface(wv_Tele ,"B4A")
CamViewExtras.ExecuteJavascript("chicken()")
End If
I know this code is missing something regarding getting the value back, and i think thats where i am clueless. Any help would be greatly appreciated...
Y.