I installed the Ns Basic AppStudio 8.0.6 version! I really enjoyed the changes! I made the changes to rotate the cord! I had to create a new project to work cool! I managed to prevent inAppBrowser from closing by modifying the file C: \ Users \ danie \ Project.appstudio \ cordova \ platforms \ android \ app \ src \ main \ java \ org \ apache \ cordova \ inappbrowser \ InAppBrowserDialog.java! Changing Line 56 this.inAppBrowser.closeDialog (); by
//this.inAppBrowser.closeDialog (); Ready InAppBrowser no longer closes!
There was a small change in the code but this is due to the version change of App Studio which was excellent
The Apk file that used to be 12 mega bytes is now only 4 mega bytes!
Follow the code below that is very functional!
Dim url
Dim sinterorno
Dim iabRef
Sub Main
ChangeForm (Form2)
url = "https://www.papelaria.net/index.php?modoapp=1"
document.addEventListener ("deviceready", onDeviceReady, False)
End Sub
Function checks ()
End Function
Function onDeviceReady ()
SetTimeout (checks, 100)
iabRef = cordova.InAppBrowser.open (url, "_blank", "location = no, fullscreen = yes, zoom = no, hardwareback = no, clearcache = yes")
iabRef.addEventListener ("loadstart", iabLoadStart)
iabRef.addEventListener ("loadstop", iabLoadStop)
iabRef.addEventListener ("loaderror", iabLoaderro)
iabRef.addEventListener ("beforeload", beforeloadCallBack)
iabRef.addEventListener ("exit", exitcallback)
End Function
Function beforeloadCallBack (params, callback)
End Function
Function exitcallback (event)
End Function
Function iabLoaderro (params)
If params.message = "net :: ERR_NAME_NOT_RESOLVED" Then
Alert1.value = "No Internet signal: Address not resolved!"
iabRef.close
ChangeForm (Form2)
Exit Sub
End If
If params.message = "net :: ERR_ADDRESS_UNREACHABLE" Then
Alert1.value = "No Internet signal: Unreachable address!"
iabRef.close
ChangeForm (Form2)
Exit Sub
End If
If params.message = "net :: ERR_CACHE_MISS" Then
Alert1.value = "Cache Missing!"
iabRef.close
ChangeForm (Form2)
Else
Alert1.value = "Unknown error!" & params.message
iabRef.close
ChangeForm (Form2)
End If
End Function
Function iabLoadStart (event)
Textarea1.text = Textarea1.text & vbCRLF & event.url;
console.log (event.type & "-" & event.url)
field = Split (event.url, "?")
If campo (0) = "https://www.papelaria.net/codigodebarra.php" Or campo (0) = "https://www.papelaria.net/codigodebarra.php/" Then
command = Split (field (1), "&")
Textarea1.text = Textarea1.text & vbCRLF & "command:" & command (0)
If command (0) = "cmd = barcode" Then
Textarea1.text = Textarea1.text & vbCRLF & "Joined to run"
return = Split (command (1), "=")
return = return (1)
iabRef.close
cordova.plugins.barcodeScanner.scan (codcerto, coderro)
End If
End If
End Function
Function iabLoadStoPreformatted textp (event)
Textarea1.text = Textarea1.text & vbCRLF & event.url
console.log (event.type & "-" & event.url)
field = Split (event.url, "?")
If campo (0) = "https://www.papelaria.net/codigodebarra.php" Or campo (0) = "https://www.papelaria.net/codigodebarra.php/" Then
command = Split (field (1), "&")
` If command (0) = "cmd = barcode" Then`
return = Split (command (1), "=")
urlretorno = return (1)
iabRef.close
cordova.plugins.barcodeScanner.scan (codcerto, coderro)
End If
End If
End Function
Function codcerto (result)
url = "https://www.papelaria.net/" & siteretorno & "? codigobarra =" & result.text
document.addEventListener ("deviceready", onDeviceReady, False)
End Function
Function coderro (result)
console.log (result.text)
End Function