#Region Project Attributes
#ApplicationLabel: test
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: TRUE
#IncludeTitle: FALSE
#End Region
Sub Process_Globals
Private rp As RuntimePermissions
End Sub
Sub Globals
Private WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
rp.CheckAndRequest(rp.PERMISSION_CAMERA)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
rp.CheckAndRequest(rp.PERMISSION_RECORD_AUDIO)
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 = WebView1
jo.RunMethod("setWebChromeClient", Array(client))
WebView1.LoadUrl("https://somesite.com")
End If
End If
End Sub
#if Java
import android.webkit.*;
public static class MyChromeClient extends WebChromeClient {
@Override
public void onPermissionRequest(PermissionRequest request) {
request.grant(request.getResources());
}
}
#End If