B4A Library UltimateWebView Custom View

One year ago, I had the opportunity to work on an application that requires a web browser to access a web application created in asp.net. The application was used in a business environment to perform more complex operations. I had a lot of difficulties with all the necessary requirements such as downloading files, webrtc service, geolocation service, uploading files from local memory, uploading files from the camera, using javascripts, etc. I lost a lot of time until I managed to do all the necessary requirements to make BA WebView approximately like other browsers on the market.

To help another less advanced programmer to avoid the problems and difficulties I found myself in, I decided to pack all my work into a library called UltimateWebView.

The purpose of the library is to implement all important classes in one library in order to make work as easy as possible. The library will be upgraded over time by adding new features and protocols.

I packed the library documentation into one zipped file that contains a UltimateWebView_Documentation.zip file. Other attachments are the library itself and BAExample.

For full library functionality, copy the following into the manifest:
Manifest:
'Important
SetApplicationAttribute(android:usesCleartextTraffic,"true")
AddPermission(android.permission.DOWNLOAD_WITHOUT_NOTIFICATION)
'---------------------
'Camera Permissions
AddPermission(android.permission.CAMERA)
AddPermission(android.permission.RECORD_AUDIO)
AddPermission(android.permission.MODIFY_AUDIO_SETTINGS)
AddPermission(android.permission.MICROPHONE)
AddPermission("android.hardware.camera")
AddManifestText(<uses-feature android:name="android.hardware.camera" android:required="true" />)
AddManifestText(<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera.flash" android:required="false" />)
'---------------------

'Geolocation Permissions
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission(android.permission.ACCESS_BACKGROUND_LOCATION)
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
'------------------------

AddManifestText(<uses-permission
   android:name="android.permission.WRITE_EXTERNAL_STORAGE"
   android:maxSdkVersion="18" />
)

AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
   <files-path name="name" path="shared" />
)

UltimateWebView is a Custom View Library and it is possible to add a View through the Designer.

Sample project:
B4AExample:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

#BridgeLogger: True

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Private txtUrl As EditText
    Private btnGo As Button
    Private UltimateWebView1 As UltimateWebView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Main")
 
    UltimateWebView1.SetWebViewClient 'Sets WebViewClient and its Events.
    UltimateWebView1.SetWebChromeClient 'Sets WebChromeClient and its Events.
    'Other UltimateWebViewSettings
    UltimateWebView1.Settings.JavaScriptEnabled=True
    UltimateWebView1.Settings.AllowContentAccess=True
    UltimateWebView1.Settings.AllowFileAccess=True
    UltimateWebView1.Settings.AppCacheEnabled=True
    UltimateWebView1.Settings.CacheMode=UltimateWebView1.Settings.CacheMode_LOAD_DEFAULT
    UltimateWebView1.Settings.JavaScriptCanOpenWindowsAutomatically=True
    UltimateWebView1.Settings.DisplayZoomControls=False
    UltimateWebView1.Settings.DomStorageEnabled=True
    UltimateWebView1.Settings.MediaPlaybackRequiresUserGesture=False
    UltimateWebView1.Settings.AllowFileAccessFromFileURLs=True
    UltimateWebView1.Settings.AllowUniversalAccessFromFileURLs=True
    UltimateWebView1.Settings.GeolocationEnabled=True
    UltimateWebView1.SetDownloadListener 'Sets and start DownloadListener'
 
    'CookieManager Settings to accept all cookies
    UltimateWebView1.CookieManager.AcceptCookies=True
    UltimateWebView1.CookieManager.AcceptThirdPartyCookies=True
    UltimateWebView1.CookieManager.AcceptFileSchemeCookies=True
    UltimateWebView1.CookieManager.Flush
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)
    If UserClosed Then
        ExitApplication
    End If
End Sub

Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
    If KeyCode=KeyCodes.KEYCODE_BACK Then
        If UltimateWebView1.CanGoBack=True Then
            UltimateWebView1.GoBack
            Return True
        Else
            Return False
        End If
    Else
        Return False
    End If
End Sub

Sub btnGo_Click
    'You can use LoadUrl2 like in code bellow
    '--------------------------
    'Dim Headerrs As Map
    'Headerrs.Initialize
    'Headerrs.Put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36")
    'UltimateWebView1.LoadUrl2(txtUrl.Text,Headerrs)
    '---------------------------
 
    UltimateWebView1.LoadUrl(txtUrl.Text)
End Sub

Sub UltimateWebView1_FileDownloadInitialized (DownloadProperties1 As DownloadProperties) 'When click to download link or button this event will bi fired.
    Log("Download INITIALIZED")
    'DownloadProperties fields:
    '---------------------------------
    'Log(DownloadProperties1.url)
    'Log(DownloadProperties1.userAgent)
    'Log(DownloadProperties1.contentDisposition)
    'Log(DownloadProperties1.mimeType)
    'Log(DownloadProperties1.contentLength)
    'Log(DownloadProperties1.cookies)
    'Log(DownloadProperties1.fileName)
    'Log(DownloadProperties1.FileExtension)
    'Log(DownloadProperties1.DownloadID)
    '---------------------------------
 
    UltimateWebView1.StartFileDownload(DownloadProperties1,"TEST",True,True) 'File will be downloaded with native DownloadManager. If you want internall download, you can use your own method with parameters from DownloadProperties.
End Sub

Sub UltimateWebView1_FileDownloadStarted (DownloadProperties1 As DownloadProperties)
    Log("Download STARTED")
    'Log(DownloadProperties1.url)
    'Log(DownloadProperties1.userAgent)
    'Log(DownloadProperties1.contentDisposition)
    'Log(DownloadProperties1.mimeType)
    'Log(DownloadProperties1.contentLength)
    'Log(DownloadProperties1.cookies)
    'Log(DownloadProperties1.fileName)
    'Log(DownloadProperties1.FileExtension)
    'Log(DownloadProperties1.DownloadID)
End Sub

Sub UltimateWebView1_FileDownloadCompleted (Success As Boolean, DownloadProperties1 As DownloadProperties)
    Log("Download COMPLETED; Success:" & Success)
    'Log(DownloadProperties1.url)
    'Log(DownloadProperties1.userAgent)
    'Log(DownloadProperties1.contentDisposition)
    'Log(DownloadProperties1.mimeType)
    'Log(DownloadProperties1.contentLength)
    'Log(DownloadProperties1.cookies)
    'Log(DownloadProperties1.fileName)
    'Log(DownloadProperties1.FileExtension)
    'Log(DownloadProperties1.DownloadID)
End Sub

Private Sub UltimateWebView1_OverrideUrl (WebResourceRequest1 As WebResourceRequest) As Boolean
    'Log(WebResourceRequest1.GetUrl)
    'Log(WebResourceRequest1.GetMethod)
    'Log(WebResourceRequest1.HasGesture)
    'Log(WebResourceRequest1.IsForMainFrame)
    'Log(WebResourceRequest1.IsRedirect)
    'Dim M As Map=WebResourceRequest1.GetRequestHeaders
    'If M.IsInitialized Then
        'For i=0 To M.Size-1
            'Log(M.GetKeyAt(i))
            'Log(M.GetValueAt(i))
        'Next
    'End If
    Return False
End Sub

Sub UltimateWebView1_PageFinished (Url As String)
 
End Sub

Sub UltimateWebView1_PageStarted (Url As String, FavIcon As Bitmap)
    'If FavIcon<>Null Then
        'do stuff...
    'End If
End Sub

Sub UltimateWebView1_PageLoadingProgressChanged(Progress As Int)
 
End Sub

Sub UltimateWebView1_ReceivedIcon (Icon As Bitmap)
    'If Icon<>Null Then
    'do stuff...
    'End If
End Sub

Sub UltimateWebView1_ReceivedTitle (Title As String)
 
End Sub

'Very important event for UltimateWebView permissions request!!!
Sub UltimateWebView1_PermissionRequest (RequestedPermission As String)
    Dim Permissions As RuntimePermissions
    Permissions.CheckAndRequest(RequestedPermission)
    Wait For Activity_PermissionResult (Permission As String, result As Boolean)
    UltimateWebView1.GrantPermission(result)
End Sub

Sub UltimateWebView1_ScaleChanged (OldScale As Float, NewScale As Float)
 
End Sub

Private Sub UltimateWebView1_ReceivedError (WebResourceRequest1 As WebResourceRequest, WebResourceError1 As WebResourceError)
    'Log("ReceivedError")
    'Log(WebResourceRequest1.GetUrl)
    'Log(WebResourceError1.Description)
    'Log(WebResourceError1.ErrorCode)
End Sub

Private Sub UltimateWebView1_ReceivedHttpError (WebResponseRequest1 As WebResourceRequest, WebResourceResponse1 As WebResourceResponse)
    'Log("ReceivedHttpError")
    'Log(WebResponseRequest1.GetUrl)
    'Log(WebResourceResponse1.Encoding)
    'Log(WebResourceResponse1.StatusCode)
End Sub

Private Sub UltimateWebView1_ReceivedHttpAuthRequest (HttpAuthHandler1 As HttpAuthHandler, HttpAuthRequestProperties1 As HttpAuthRequestProperties)
    'Log("ReceivedHttpAuthRequest")
    'Log(HttpAuthRequestProperties1.Host)
    'Log(HttpAuthRequestProperties1.Realm)
End Sub

Private Sub UltimateWebView1_ReceivedLoginRequest (LoginRequestProperties1 As LoginRequestProperties)
    'Log("ReceivedLoginRequest")
    'Log(LoginRequestProperties1.Realm)
    'Log(LoginRequestProperties1.Account)
    'Log(LoginRequestProperties1.Args)
End Sub

Private Sub UltimateWebView1_UpdateVisitedHistory (Url As String, IsReload As Boolean)
    'Log("UpdateVisitedHistory")
    'Log(Url)
    'Log(IsReload)
End Sub


Private Sub UltimateWebView1_PageCommitVisible (Url As String)
 
End Sub

Private Sub UltimateWebView1_ShouldInterceptRequest (Request As WebResourceRequest) As WebResourceResponse
    'Log("ShouldInterceptRequest")
    'Log(Request.GetUrl)
    'Dim ins As InputStream
    'ins.InitializeFromBytesArray(Array As Byte(100,231,155),0,3)
    'Dim Response As WebResourceResponse
    'Response.Initialize
    'Response.Create("text/plain","utf-8",ins)
    'Return Response
    Return Null
End Sub


Private Sub UltimateWebView1_JsAlert (JsProperties1 As JsProperties, JsResult1 As JsResult) As Boolean
    'Log("JsAlert")
    'Log(JsProperties1.Url)
    'Log(JsProperties1.Message)
    'Log(JsProperties1.DefaultValue)
    'JsResult1.Confirm
    Return False
End Sub

Private Sub UltimateWebView1_JsBeforeUnload (JsProperties1 As JsProperties, JsResult1 As JsResult) As Boolean
    'Log("JsBeforeUnload")
    'Log(JsProperties1.Url)
    'Log(JsProperties1.Message)
    'Log(JsProperties1.DefaultValue)
    'JsResult1.Confirm
    Return False
End Sub

Private Sub UltimateWebView1_JsConfirm (JsProperties1 As JsProperties, JsResult1 As JsResult) As Boolean
    'Log("JsConfirm")
    'Log(JsProperties1.Url)
    'Log(JsProperties1.Message)
    'Log(JsProperties1.DefaultValue)
    'JsResult1.Confirm
    Return False
End Sub

UltimateWebView
Author:
Ivica Golubovic
Version: 1.1

Changes:
  • Method GetWebView is removed from UltimateWebView Class.
  • Property WebView (get/set) added to UltimateWebView Class. You can now use this property to set existing WebView to UltimateWebView.
  • Added method ClearFormData.
  • Added method ClearMatches.
  • Added method ClearSslPreferences.
  • Added method ComputeScroll.
  • Added class WebBackForwardList.
  • Added type WebHistoryItem to class WebBackForwardList.
  • Added method CopyBackForwardList.
  • Added method FindAllAsync.
  • Added method FindNext.
  • Added method FlingScroll.
You can now import an existing WebView object into UltimateWebView, it is not necessary to add an UltimateWebView object through the Designer.
Example:
Example:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Private WebView1 As WebView
    Private UltimateWebView1 As UltimateWebView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Main")
 
    'First Initialize UltimateWebView
    UltimateWebView1.Initialize(Me,"UltimateWebView1")
    'Import native WebView into UltimateWebView
    UltimateWebView1.WebView=WebView1
 
    UltimateWebView1.SetWebViewClient
    UltimateWebView1.SetWebChromeClient
    UltimateWebView1.Settings.JavaScriptEnabled=True
    UltimateWebView1.Settings.AllowContentAccess=True
    UltimateWebView1.Settings.AllowFileAccess=True
    UltimateWebView1.Settings.AppCacheEnabled=True
    UltimateWebView1.Settings.CacheMode=UltimateWebView1.Settings.CacheMode_LOAD_DEFAULT
    UltimateWebView1.Settings.JavaScriptCanOpenWindowsAutomatically=True
    UltimateWebView1.Settings.DisplayZoomControls=False
    UltimateWebView1.Settings.DomStorageEnabled=True
    UltimateWebView1.Settings.MediaPlaybackRequiresUserGesture=False
    UltimateWebView1.Settings.AllowFileAccessFromFileURLs=True
    UltimateWebView1.Settings.AllowUniversalAccessFromFileURLs=True
    UltimateWebView1.Settings.GeolocationEnabled=True
    UltimateWebView1.SetDownloadListener
 
    UltimateWebView1.CookieManager.AcceptCookies=True
    UltimateWebView1.CookieManager.AcceptThirdPartyCookies=True
    UltimateWebView1.CookieManager.AcceptFileSchemeCookies=True
    UltimateWebView1.CookieManager.Flush
End Sub

A very important event for the permissions required for WebRTC, Geolocation, etc. Without this event permisions will be denied.
Permission Event:
Sub UltimateWebView1_PermissionRequest (RequestedPermission As String)
    Dim Permissions As RuntimePermissions
    Permissions.CheckAndRequest(RequestedPermission)
    Wait For Activity_PermissionResult (Permission As String, result As Boolean)
    UltimateWebView1.GrantPermission(result)
End Sub

UltimateWebView
Author:
Ivica Golubovic
Version: 1.2

Changes:
  • Added event FileChooserInitialized.
  • Added class FileChooserParams.
  • Added method FileChooserStart.
  • Added automatic permissions requests for UploadFileChooser.
  • Added the ability to upload multiple files with UploadFileChooser if allowed.
  • Added event OverrideUrlWithExternalAppIntent.
FileChooserInitialized event added. It will be activated when a Web source requires uploading a file or multiple files. To start FileChooser, call the FileChooserStart method or use event objects the way you want. Do not add this event if you do not want your application to have this feature.
Example::
Private Sub UltimateWebView1_FileChooserInitialized (FilePathCallback As Object, FileChooserParams1 As FileChooserParams)
    'ForceIsCaptureEnabled As Boolean:
    '    True: Use resources such as camera, microphone, etc. by force if the required file format is appropriate.
    '    False: Use a predefined value assigned to FileChooserParams.
    UltimateWebView1.FileChooserStart(FilePathCallback,FileChooserParams1,True) 'Use this method or use your own method from given parameters
End Sub

Added event OverrideUrlWithExternalAppIntent which will process the request to launch an external application outside of UltimateWebView (e.g. PlayStore, Maps, AppGalery, applies to all installed applications). The result of the event is an Intent which you can use in the way you want (e.g. StartActivity (Intent) - opens the application or application chooser, depending on the case).
Example::
Sub UltimateWebView1_OverrideUrlWithExternalAppIntent (WebResourceRequest1 As WebResourceRequest, ExternalAppIntent As Intent) As Boolean
    'ExternalAppIntent - Intent to use
    StartActivity(ExternalAppIntent) 'You can use this method or do with event what ever you want
    Return True 'True to stop page loading and handling event, False to finish loading page (Error web page will be shown)
End Sub

UltimateWebView
Author:
Ivica Golubovic
Version: 1.3
Changes: Visit this post: https://www.b4x.com/android/forum/threads/ultimatewebview-custom-view.135666/post-859400


UltimateWebView
Author:
Ivica Golubovic
Version: 1.4
Changes: Visit this post: https://www.b4x.com/android/forum/threads/ultimatewebview-custom-view.135666/post-860033

UltimateWebView
Author:
Ivica Golubovic
Version: 1.5
Changes: Visit this post: https://www.b4x.com/android/forum/threads/ultimatewebview-custom-view.135666/post-861510

UltimateWebView
Author:
Ivica Golubovic
Version: 1.6
Changes: Visit this post for description: https://www.b4x.com/android/forum/threads/ultimatewebview-custom-view.135666/post-864977

UltimateWebView
Author:
Ivica Golubovic
Version: 1.7
Changes: Visit this post: https://www.b4x.com/android/forum/threads/ultimatewebview-custom-view.135666/post-866430

UltimateWebView
Author:
Ivica Golubovic
Version: 2.0
Changes: Visit this post: https://www.b4x.com/android/forum/threads/ultimatewebview-custom-view.135666/post-869686

UltimateWebView
Author:
Ivica Golubovic
Version: 2.01
Changes: Visit this post: https://www.b4x.com/android/forum/threads/ultimatewebview-custom-view.135666/post-869704

UltimateWebView
Author:
Ivica Golubovic
Version: 2.1
Changes: Visit this post: https://www.b4x.com/android/forum/threads/ultimatewebview-custom-view.135666/post-871370

UltimateWebView
Author:
Ivica Golubovic
Version: 2.11
Changes: Fixed bug where object is not visible in Designer (AddView-CustomView-UltimateWebView).

UltimateWebView
Author:
Ivica Golubovic
Version: 2.12
Changes: Visit this post: https://www.b4x.com/android/forum/threads/ultimatewebview-custom-view.135666/post-875746


REFERENCES:
UltimateWebView
Author:
Ivica Golubovic
Version: 2.12
  • ConsoleMessage
    • Functions:
      • Create (Message As String, SourceID As String, LineNumber As Int, MSGLevel As Object) As String
        Added in API level 8.
      • Create2 (JavaConsoleMessage As Object) As String
        Added in API level 8.
      • Initialize As String
        Initializes the object.
        Added in API level 8.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
    • Properties:
      • LineNumber As Int [read only]
        Added in API level 8.
      • Message As String [read only]
        Added in API level 8.
      • MessageLevel As Object [read only]
        Added in API level 8.
      • MessageLevels As MessageLevels [read only]
        Added in API level 8.
      • SourceId As String [read only]
        Added in API level 8.
  • DownloadProperties
    • Fields:
      • ContentDisposition As String
      • ContentLength As Long
      • Cookies As String
      • DownloadID As Long
      • FileExtension As String
      • FileName As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • MimeType As String
      • Url As String
      • UserAgent As String
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • FileChooserParams
    • Functions:
      • Initialize (JavaFileChooserParams As Object) As String
        Initializes the object.
        Added in API level 21.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • ParseResult (ResultCode As Int, Data As Intent) As Object
        Parse the result returned by the file picker activity.
        Added in API level 21.
    • Properties:
      • AcceptTypes As String() [read only]
        Returns an array of acceptable MIME types.
        Added in API level 21.
      • FilenameHint As String [read only]
        The file name of a default selection if specified, or null.
        Added in API level 21.
      • Intent As Intent [read only]
        Creates an intent that would start a file picker for file selection.
        Added in API level 21.
      • IsCaptureEnabled As Boolean [read only]
        Returns preference for a live media captured value (e.g. Camera, Microphone).
        Added in API level 21.
      • Mode As Int [read only]
        Returns file chooser mode.
        Added in API level 21.
      • ModeAsString As String [read only]
        Returns string value for file chooser mode.
        Added in API level 21.
      • Title As String [read only]
        Returns the title to use for this file selector.
        Added in API level 21.
  • FileProvider
    • Fields:
      • SharedFolder As String
      • UseFileProvider As Boolean
    • Functions:
      • GetFileUri (FileName As String) As Object
        Returns the file uri.
      • Initialize As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • SetFileUriAsIntentData (Intent As Intent, FileName As String) As String
        Replaces the intent Data field with the file uri.
        Resets the type field. Make sure to call Intent.SetType after calling this method
  • HttpAuthHandler
    • Functions:
      • Cancel As String
        Instructs the WebView to cancel the authentication request.
        Added in API level 1.
      • Initialize (JavaHttpAuthHandler As Object) As String
        Initializes the object.
        Added in API level 1.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Proceed (Username As String, Password As String) As String
        Instructs the UltimateWebView to proceed with the authentication with the given credentials.
        Added in API level 1.
      • toObject As Object
        Returns Object as android.webkit.HttpAuthHandler which can be used in Java Code.
        Added in API level 1.
      • UseHttpAuthUsernamePassword As Boolean
        Gets whether the credentials stored for the current host.
        Added in API level 1.
  • HttpAuthRequestProperties
    • Fields:
      • Host As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Realm As String
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • JsPromptResult
    • Functions:
      • Confirm (Result As String) As String
        Added in API level 1.
      • Initialize (JavaJsPromptResult As Object) As String
        Initializes the object.
        Added in API level 1.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • toObject As Object
        Returns Object as android.webkit.JsPromptResult which can be used in Java Code.
        Added in API level 1.
  • JsProperties
    • Fields:
      • DefaultValue As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Message As String
      • Url As String
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • JsResult
    • Functions:
      • Cancel As String
        Handle the result if the user cancelled the dialog.
        Added in API level 1.
      • Confirm As String
        Handle a confirmation response from the user.
        Added in API level 1.
      • Initialize (JavaJsResult As Object) As String
        Initializes the object.
        Added in API level 1.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • toObject As Object
        Returns Object as android.webkit.JsResult which can be used in Java Code.
        Added in API level 1.
  • LayoutChangeProperties
    • Fields:
      • Height As Int
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Left As Int
      • Top As Int
      • Width As Int
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • LoginRequestProperties
    • Fields:
      • Account As String
      • Args As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Realm As String
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • MessageLevels
    • Fields:
      • DEBUG As Object
      • ERROR As Object
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • LOG_ As Object
      • TIP As Object
      • WARNING As Object
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • SafeBrowsingResponse
    • Fields:
      • ThreatType As Int
      • ThreatTypeString As String
    • Functions:
      • BackToSafety (ParamBoolean As Boolean) As String
        Act as if the user clicked the "back to safety" button.
        ParamBoolean As Boolean: true to enable Safe Browsing reporting.
        Added in API level 27.
      • Initialize (ObjectFromJava As Object) As String
        Initializes the object. ObjectFromJava As android.webkit.SafeBrowsingResponse. Object should not be user initialized.
        Added in API level 27.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Proceed (ParamBoolean As Boolean) As String
        Act as if the user clicked the "visit this unsafe site" button.
        ParamBoolean As Boolean: true to enable Safe Browsing reporting.
        Added in API level 27.
      • ShowInterstitial (ParamBoolean As Boolean) As String
        Display the default interstitial.
        ParamBoolean As Boolean: true if the interstitial should show a reporting checkbox.
        Added in API level 27.
      • ToObject As Object
        Returns Object as android.webkit.SafeBrowsingResponse which can be used in Java Code.
        Added in API level 27.
  • ScrollChangeProperties
    • Fields:
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • X As Int
      • Y As Int
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • UltimateCookieManager
    • Functions:
      • Flush As String
        Ensures all cookies currently accessible through the getCookie API are written to persistent storage.
        Added in API level 21.
      • GetCookie (Url As String) As String
        Gets all the cookies for the given URL.
        Added in API level 1.
      • HasCookies As Boolean
        Gets whether there are stored cookies.
        Added in API level 1.
      • Initialize (UltimateWebView1 As UltimateWebView) As String
        Initializes the object.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • RemoveAllCookies As String
        Removes all cookies.
        Added in API level 1.
      • RemoveExpiredCookie As String
        This method was deprecated in API level 21. The WebView handles removing expired cookies automatically.
        Added in API level 1.
      • RemoveSessionCookies As String
        Removes all session cookies, which are cookies without an expiration date.
        Added in API level 1.
      • SetCookie (Url As String, Value As String) As String
        Sets a single cookie (key-value pair) for the given URL.
        Added in API level 21.
    • Properties:
      • AcceptCookies As Boolean
        Gets or sets whether the application's UltimateWebView instances send and accept cookies.
        Added in API level 1.
      • AcceptFileSchemeCookies As Boolean
        Gets or sets whether the application's UltimateWebView instances should send and accept cookies for file scheme URLs.
        This method was deprecated in API level 30. This setting is not secure.
        Added in API level 12
      • AcceptThirdPartyCookies As Boolean
        Gets or sets whether the UltimateWebView should allow third party cookies to be set.
        Added in API level 21.
  • UltimateJavascriptInterface
    • Functions:
      • Initialize (Callback As Object) As String
        Initializes the object.
        Added in API level 17.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • ToObject As Object
        Returns Object as android.webkit.JavascriptInterface which can be used in Java Code.
        Added in API level 17.
  • UltimateMimeTypeMap
    • Functions:
      • ExtensionFromMimeType (MimeType As String) As String
        Return the registered extension for the given MIME type.
        Added in API level 1.
      • FileExtensionFromUrl (Url As String) As String
        Returns the file extension or an empty string if there is no extension.
        Added in API level 1.
      • HasExtension (Extension As String) As Boolean
        Return true if the given extension has a registered MIME type.
        Added in API level 1.
      • HasMimeType (MimeType As String) As Boolean
        Return true if the given MIME type has an entry in the map.
        Added in API level 1.
      • Initialize As String
        Initializes the object.
        Added in API level 1.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • MimeTypeFromExtension (Extension As String) As String
        Return the MIME type for the given extension.
        Added in API level 1.
  • UltimateURLUtil
    • Functions:
      • ComposeSearchUrl (InQuery As String, Template As String, QueryPlaceHolder As String) As String
        Added in API level 1.
      • Decode (Url As Byte()) As Byte()
        Added in API level 1.
      • GuessFileName (Url As String, ContentDisposition As String, MimeType As String) As String
        Guesses canonical filename that a download would have, using the URL and contentDisposition.
        Added in API level 1.
      • GuessUrl (InUrl As String) As String
        Cleans up (if possible) user-entered web addresses
        Added in API level 1.
      • Initialize As String
        Initializes the object.
        Added in API level 1.
      • IsAboutUrl (Url As String) As Boolean
        Added in API level 1.
      • IsAssetUrl (Url As String) As Boolean
        Added in API level 1.
      • IsContentUrl (Url As String) As Boolean
        Added in API level 1.
      • IsDataUrl (Url As String) As Boolean
        Added in API level 1.
      • IsFileUrl (Url As String) As Boolean
        Added in API level 1.
      • IsHttpsUrl (Url As String) As Boolean
        Added in API level 1.
      • IsHttpUrl (Url As String) As Boolean
        Added in API level 1.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • IsJavaScriptUrl (Url As String) As Boolean
        Added in API level 1.
      • IsNetworkUrl (Url As String) As Boolean
        Added in API level 1.
      • IsValidUrl (Url As String) As Boolean
        Added in API level 1.
      • StripAnchor (Url As String) As String
        Strips the url of the anchor.
        Added in API level 1.
  • UltimateWebView
    • Events:
      • ConsoleMessage (ConsoleMessage1 As ConsoleMessage) As Boolean 'Works from API level 8 and above. WebChromeClient required.
      • CreateChildWindow (IsDialog As Boolean, IsUserGesture As Boolean) As UltimateWebView 'Works from API level 1 and above. WebChromeClient required.
      • ExecuteJavaScriptResult (Result As String) 'Works from API level 19 and above.
      • FileChooserInitialized (FilePathCallback As Object, FileChooserParams1 As FileChooserParams) 'Works from API level 21 and above. WebChromeClient required.
      • FileDownloadCompleted (Success As Boolean, DownloadProperties1 As DownloadProperties) 'Works from API level 9 and above. DownloadListener required.
      • FileDownloadInitialized (DownloadProperties1 As DownloadProperties) 'Works from API level 1 and above. DownloadListener required.
      • FileDownloadStarted (DownloadProperties1 As DownloadProperties) 'Works from API level 9 and above. DownloadListener required.
      • JsAlert (JsProperties1 As JsProperties, JsResult1 As JsResult) As Boolean 'Works from API level 1 and above. WebChromeClient required.
      • JsBeforeUnload (JsProperties1 As JsProperties, JsResult1 As JsResult) As Boolean 'Works from API level 1 and above. WebChromeClient required.
      • JsConfirm (JsProperties1 As JsProperties, JsResult1 As JsResult) As Boolean 'Works from API level 1 and above. WebChromeClient required.
      • JsPrompt (JsProperties1 As JsProperties, JsPromptResult1 As JsPromptResult) As Boolean 'Works from API level 1 and above. WebChromeClient required.
      • LoadResource (Url As String) 'Works from API level 1 and above. WebViewClient required.
      • OnFocusChange (HasFocus As Boolean) 'Works from API level 1 and above.
      • OnKeyEvent (KeyCode As Int, AndroidViewKeyEvent As Object) As Boolean 'Works from API level 1 and above.
      • OnLayoutChange (New As LayoutChangeProperties, Old As LayoutChangeProperties) 'Works from API level 11 and above.
      • OnScrollChange (New As ScrollChangeProperties, Old As ScrollChangeProperties) 'Works from API level 23 and above.
      • OnShouldOverrideKeyEvent (KeyCode As Int, AndroidViewKeyEvent As Object) As Boolean 'Works from API level 1 and above. WebViewClient required.
      • OnTouch (AndroidViewMotionEvent As Object) As Boolean 'Works from API level 1 and above.
      • OnUnhandledKeyEvent (KeyCode As Int, AndroidViewKeyEvent As Object) 'Works from API level 1 to API level 21. WebViewClient required.
      • OnUnhandledKeyEvent2 (KeyCode As Int, AndroidViewKeyEvent As Object) As Boolean 'Works from API level 28 and above.
      • OverrideUrl (Url As String) As Boolean 'Works from API level 1 to API level 23. WebViewClient required.
      • OverrideUrl2 (WebResourceRequest1 As WebResourceRequest) As Boolean 'Works from API level 24 and above. WebViewClient required.
      • OverrideUrlWithExternalAppIntent (Url As String, ExternalAppIntent As Intent) As Boolean 'Works from API level 1 to API level 23. WebViewClient required.
      • OverrideUrlWithExternalAppIntent2 (WebResourceRequest1 As WebResourceRequest, ExternalAppIntent As Intent) As Boolean 'Works from API level 24 and above. WebViewClient required.
      • PageCommitVisible (Url As String) 'Works from API level 23 and above. WebViewClient required.
      • PageFinished (Url As String) 'Works from API level 1 and above. WebViewClient required.
      • PageLoadingProgressChanged (Progress As Int) 'Works from API level 1 and above. WebChromeClient required.
      • PageStarted (Url As String, FavIcon As Bitmap) 'Works from API level 1 and above. WebViewClient required.
      • PermissionRequest (RequestedPermission As String) 'Works from API level 21 and above. WebChromeClient required.
      • ReceivedError (ErrorCode As Int, Description As String, FailingUrl As String) 'Works from API level 1 to API level 23. WebViewClient required.
      • ReceivedError2 (WebResourceRequest1 As WebResourceRequest, WebResourceError1 As WebResourceError) 'Works from API level 23 and above. WebViewClient required.
      • ReceivedHttpAuthRequest (HttpAuthHandler1 As HttpAuthHandler, HttpAuthRequestProperties1 As HttpAuthRequestProperties) 'Works from API level 1 and above. WebViewClient required.
      • ReceivedHttpError (WebResponseRequest1 As WebResourceRequest, WebResourceResponse1 As WebResourceResponse) 'Works from API level 23 and above. WebViewClient required.
      • ReceivedIcon (Icon As Bitmap) 'Works from API level 1 and above. WebChromeClient required.
      • ReceivedLoginRequest (LoginRequestProperties1 As LoginRequestProperties) 'Works from API level 12 and above. WebViewClient required.
      • ReceivedTitle (Title As String) 'Works from API level 1 and above. WebChromeClient required.
      • RenderProcessGone (DidCrash As Boolean, RendererPriorityAtExit As Int) 'Works from API level 26 and above. WebViewClient required.
      • SafeBrowsingHit (WebResourceRequest1 As WebResourceRequest, SafeBrowsingResponse1 As SafeBrowsingResponse) 'Works from API level 27 and above. WebViewClient required.
      • ScaleChanged (OldScale As Float, NewScale As Float) 'Works from API level 1 and above. WebViewClient required.
      • ShouldInterceptRequest (Request As WebResourceRequest) As WebResourceResponse 'Works from API level 21 and above. WebViewClient required.
      • UpdateVisitedHistory (Url As String, IsReload As Boolean) 'Works from API level 1 and above. WebViewClient required.
    • Functions:
      • AddJavascriptInterface (JavascriptInterface As Object, Name As String) As String
        Injects the supplied JavascriptInterface As Object into this UltimateWebView. The object is injected into all frames of the web page, including all the iframes, using the supplied name. This allows the Java object's methods to be accessed from JavaScript.
        Added in API level 1.
      • BringToFront As String
      • CanGoBack As Boolean
        Gets whether this UltimateWebView has a back history item.
        Added in API level 1.
      • CanGoBackOrForward (Steps As Int) As Boolean
        Gets whether the page can go back or forward the given number of steps.
        Steps as Int (negative - back or positive - forward number of steps to move the history).
        Added in API level 1.
      • CanGoForward As Boolean
        Gets whether this UltimateWebView has a forward history item.
        Added in API level 1.
      • CaptureScreenshotToBitmap As Bitmap
        Capture UltimateWebView visible area to Bitmap.
      • CaptureScreenshotToImageFile (FilePath As String, FileNameWithExtension As String, ImageType As String, ImageQuality As Int) As Boolean
        Capture UltimateWebView visible area to Image File.
        Permission WRITE_EXTERNAL_STORAGE required
        ImageType: "jpeg" or "png" or "webp"
        ImageQuality: 1 to 100
        For API level below 29 you must first request WRITE_EXTERNAL_STORAGE permission.
        For API level 29 and above, you must save the file to a Shared Folder (FileProvider).
      • ClearCache (IncludeDiskFiles As Boolean) As String
        Clears the resource cache. Note that the cache is per-application, so this will clear the cache for all UltimateWebViews used.
        IncludeDiskFiles As Boolean (if false, only the RAM cache is cleared)
        Added in API level 1.
      • ClearFocus As String
        Called when this UltimateWebView wants to give up focus.
        Added in API level 1.
      • ClearFormData As String
        Removes the autocomplete popup from the currently focused form field, if present.
        Added in API level 1.
      • ClearHistory As String
        Tells this UltimateWebView to clear its internal back/forward list.
        Added in API level 1
      • ClearMatches As String
        Clears the highlighting surrounding text matches created by findAllAsync(String).
        Added in API level 3.
      • ClearSslPreferences As String
        Clears the SSL preferences table stored in response to proceeding with SSL certificate errors.
        Added in API level 1.
      • ComputeScroll As String
        Called by a parent to request that a child update its values for mScrollX and mScrollY if necessary.
        Added in API level 1
      • DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) As String
      • EnableSlowWholeDocumentDraw As String
        For apps targeting the L release, UltimateWebView has a new default behavior that reduces memory footprint and increases performance by intelligently choosing the portion of the HTML document that needs to be drawn. These optimizations are transparent to the developers.
        Added in API level 21
      • ExecuteJavaScript (JavaScript As String) As String
        Execute Javascript in UltimateWebView.
        Important: UltimateWebView1.Settings.JavaScriptEnabled=True 'Must be set to True somewhere in code
        Added in API level 19.
      • ExecuteJavaScript2 (JavaScript As String) As String
        Execute Javascript in UltimateWebView and got asynchronius backward Result.
        Event "ExecuteJavaScriptResult (Result as String)" will be fired when result is available. Result can be "null".
        Important: UltimateWebView1.Settings.JavaScriptEnabled=True 'Must be set to True somewhere in code
        Added in API level 19
        Example:
        UltimateWebView1.Settings.JavaScriptEnabled=True 'Must be set to True somewhere in code
        UltimateWebView1.ExecuteJavascript2([Your JavaScript Code])
        Wait For UltimateWebView1_ExecuteJavaScriptResult (Result As String)
        'Do your stuff with Result
      • FileChooserStart (FilePathCallback As Object, FileChooserParams1 As FileChooserParams, ForceIsCaptureEnabled As Boolean) As String
        You can use this method to run FileChooser to upload a file. It is important that you use this method in the FileChooserInitialized event.
        FilePathCallback and FileChooserParams1 are initialized by Event.
        ForceIsCaptureEnabled As Boolean - True: Use resources such as camera, microphone, etc. by force if the required file format is appropriate. False: Use a predefined value assigned to FileChooserParams.
        Added in API level 21. It will not work for lower API's.
      • FindAllAsync (Find As String) As String
        Finds all instances of find on the page and highlights them, asynchronously.
        Added in API level 16.
      • FindFocus As View
        Find the view in the hierarchy rooted at this view that currently has focus.
        Added in API level 1.
      • FindNext (Forward As Boolean) As String
        Highlights and scrolls to the next match found by FindAllAsync(Find As String), wrapping around page boundaries as necessary.
        Added in API level 3.
      • FlingScroll (X As Int, Y As Int) As String
        Added in API level 1.
      • GoBack As String
        Goes back in the history of this UltimateWebView.
        Added in API level 1.
      • GoBackOrForward (Steps As Int) As String
        Goes to the history item that is the number of steps away from the current item. Steps is negative if backward and positive if forward.
        Added in API level 1.
      • GoForward As String
        Goes forward in the history of this UltimateWebView.
        Added in API level 1.
      • GrantPermission (Granted As Boolean) As String
        Use to grant or deny permissions which is required by loaded WebSite (Camera, Microphone, Geolocation, Externall Storage...).
        Event PermissionRequest (RequestedPermission As String) will be fired when permission is required.
        Use RuntimePermissions library to handle permission request.
        Example:
        Sub UltimateWebView1_PermissionRequest (RequestedPermission As String)
        Dim rp As RuntimePermissions
        rp.CheckAndRequest(RequestedPermission)
        Wait For Activity_PermissionResult (Permission As String, result As Boolean)
        UltimateWebView1.GrantPermission(result)
        End Sub
      • Initialize (Callback As Object, EventName As String) As String
        Method is called automatically when object is added through Designer.
      • Invalidate As String
      • InvokeZoomPicker As String
        Invokes the graphical zoom picker widget for this UltimateWebView.
        Added in API level 1.
      • IsFocused As Boolean
        Returns true if this view has focus.
        Added in API level 26.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • LoadData (Data As String, MimeType As String, Encoding As String) As String
        Note that JavaScript's same origin policy means that script running in a page loaded using this method will be unable to access content loaded using any scheme other than 'data', including 'http(s)'. To avoid this restriction, use LoadDataWithBaseURL() with an appropriate base URL.
        The encoding parameter specifies whether the data Is base64 Or URL encoded. If the data Is base64 encoded, the value of the encoding parameter must be "base64".
        Added in API level 1.
      • LoadDataWithBaseURL (BaseUrl As String, Data As String, MimeType As String, Encoding As String, HistoryUrl As String) As String
        Loads the given data into this UltimateWebView, using baseUrl as the base URL for the content. The base URL is used both to resolve relative URLs and when applying JavaScript's same origin policy. The historyUrl is used for the history entry.
        Added in API level 1.
      • LoadFileFromDirAssets (FileName As String, IncludeSubFolders As Boolean) As String
        Loads file (HTML, TXT, PNG, JPG...) from DirAssets folder into UltimateWebView.
        FileName As String - Name of file or file path and name (Example: "test.html" or "TestFolder/test.html").
        IncludeSubFolders As Boolean - True for an html file whose objects are in a subfolder or multiple subfolders. False for an html file that has no additional objects in the subfolders but only at the root of the Asset folder. For a non html files value is not important (True or False).
        Added in API level 1.
      • LoadHTMLString (HTMLString As String) As String
        Use this method to load HTML string into UltimateWebView.
        Works on API level 1 and above.
      • LoadUrl (Url As String) As String
        Loads the given URL.
        Added in API level 1.
      • LoadUrl2 (Url As String, AdditionalHttpHeaders As Map) As String
        Loads the given URL with additional HTTP headers, specified as a map from name to value. Note that if this map contains any of the headers that are set by default by this UltimateWebView, such as those controlling caching, accept types or the User-Agent, their values may be overridden by this UltimateWebView's defaults.
        Added in API level 8
      • PageDown (ToBottom As Boolean) As String
        Scrolls the contents of this UltimateWebView down by half the page size.
        ToBottom As Boolean (true to jump to bottom of page).
        Added in API level 1.
      • PageUp (ToTop As Boolean) As String
        Scrolls the contents of this UltimateWebView up by half the view size.
        ToTop As Boolean (true to jump to the top of the page).
        Added in API level 1.
      • Pause As String
        Does a best-effort attempt to pause any processing that can be paused safely, such as animations and geolocation. Note that this call does not pause JavaScript. To pause JavaScript globally, use pauseTimers().
        Added in API level 11
      • PauseTimers As String
        Pauses all layout, parsing, and JavaScript timers for all UltimateWebViews. This is a global requests, not restricted to just this UltimateWebView. This can be useful if the application has been paused.
        Added in API level 1.
      • PostUrl (Url As String, PostData As Byte()) As String
        Loads the URL with postData using "POST" method into this WebView.
        Added in API level 5.
      • PrintContent As String
        This method is used to print UltimateWebView content.
      • Reload As String
        Reloads the current URL.
        Added in API level 1.
      • RemoveJavascriptInterface (Name As String) As String
        Removes a previously injected Java object from this UltimateWebView. Note that the removal will not be reflected in JavaScript until the page is next (re)loaded.
        Added in API level 11
      • RemoveView As String
        Use this method to remove this view from parent.
      • RequestFocus As Boolean
        Call this to try to give focus to UltimateWebView.
        Added in API level 1.
      • Resume As String
        Resumes a UltimateWebView after a previous call to Pause.
        Added in API level 11.
      • ResumeTimers As String
        Resumes all layout, parsing, and JavaScript timers for all UltimateWebViews. This will resume dispatching all timers.
        Added in API level 1.
      • SaveWebArchive (Filename As String) As String
        Saves the current view as a web archive.
        Filename As String (the filename where the archive should be placed This value cannot be null).
        Added in API level 11
      • SendToBack As String
      • SetRendererPriorityPolicy (RendererRequestedPriority As Int, WaivedWhenNotVisible As Boolean) As String
        Set the renderer priority policy for this UltimateWebView.
        Added in API level 26
      • StartFileDownload (DownloadProperties1 As DownloadProperties, DownloadManagerDescription As String, AllowScanningByMediaScanner As Boolean, DownloadManagerNotification As Boolean) As String
        Use this method to download file with native Download Manager.
        Events:
        FileDownloadStarted (DownloadProperties1 As DownloadProperties)
        FileDownloadCompleted (Success As Boolean, DownloadProperties1 As DownloadProperties)
        File will be downloaded in "Download" folder.
        Added in API level 9. It will not work for lower API's.
      • StopLoading As String
        Stops the current load.
        Added in API level 1.
      • ZoomBy (ZoomFactor As Float) As String
        Performs a zoom operation in this UltimateWebView.
        ZoomFactor As Float (the zoom factor to apply. The zoom factor will be clamped to the UltimateWebView's zoom limits. This value must be in the range 0.01 to 100.0 inclusive).
        Added in API level 21
      • ZoomIn As Boolean
        Performs zoom in in this UltimateWebView.
        Added in API level 1.
      • ZoomOut As Boolean
        Performs zoom out in this UltimateWebView.
        Added in API level 1.
    • Properties:
      • AccessibilityClassName As String [read only]
        Return the class name of this object to be used for accessibility purposes.
        Added in API level 23.
      • BackgroundColor As Int [write only]
        Sets the background color for this view.
        Added in API level 1.
      • Color As Int [write only]
      • Constants As UltimateWebViewConstants [read only]
      • ContentHeight As Int [read only]
        Gets the height in pixels of the HTML content.
        Added in API level 1.
      • CookieManager As UltimateCookieManager
        Gets or sets UltimateCookieManager methods and properties. Class is auto initialized.
      • CopyBackForwardList As WebBackForwardList [read only]
        Gets the WebBackForwardList for this UltimateWebView. This contains the back/forward list for use in querying each item in the history stack. This is a copy of the private WebBackForwardList so it contains only a snapshot of the current state. Multiple calls to this method may return different objects. The object returned from this method will not be updated to reflect any new state.
        Added in API level 1.
      • DataDirectorySuffix As String [write only]
        Define the directory used to store WebView data for the current process.
        Added in API level 28.
      • DownloadListenerEnabled As Boolean
        Enable or Disable Download Listener.
        Events: FileDownloadInitialized (DownloadProperties1 as DownloadProperties)
        Use StartFileDownload method to download file with native Download Manager, or use your own method.
        Added in API level 1.
      • Enabled As Boolean
      • FavIcon As Bitmap [read only]
        Gets the favicon for the current page.
        Added in API level 1.
      • Height As Int
      • InitialScale As Int [write only]
        Sets the initial scale in percent for this UltimateWebView. 0 means default.
        Added in API level 1.
      • IsPrivateBrowsingEnabled As Boolean [read only]
        Gets whether private browsing is enabled in this UltimateWebView.
        Added in API level 11.
      • Left As Int
      • MimeTypeMap As UltimateMimeTypeMap
        Gets or sets UltimateMimeTypeMap methods and properties. Class is auto initialized.
      • NetworkAvailable As Boolean [write only]
        Informs WebView of the network state.
        Added in API level 3.
      • OnCheckIsTextEditor As Boolean [read only]
        Check whether the called view is a text editor, in which case it would make sense to automatically display a soft input window for it.
        Added in API level 3.
      • OriginalUrl As String [read only]
        Gets the original URL for the current page.
        Added in API level 3.
      • OverScrollMode As Int [write only]
        Set the over-scroll mode for this view.
        Values: OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS (allow over-scrolling only if the view content is larger than the container), or OVER_SCROLL_NEVER. Setting the over-scroll mode of a view will have an effect only if the view is capable of scrolling.
        Added in API level 9
      • Padding As Int()
      • Parent As Object [read only]
      • Progress As Int [read only]
        Gets the progress for the current page.
        Added in API level 1.
      • SafeBrowsingPrivacyPolicyUrl As ba.uri.androidneturi [read only]
        Returns a URL pointing to the privacy policy for Safe Browsing reporting.
        Gets android.net.Uri as AndroidNetUri. Link for AndroidNetUri library and documentations:
        https://www.b4x.com/android/forum/threads/androidneturi-library.136402/
        Added in API level 27.
      • Settings As UltimateWebViewSettings
        Gets or sets UltimateWebView Settings. Class is auto initialized.
      • Tag As Object
      • Text As String
      • Title As String [read only]
        Gets the title for the current page.
        Added in API level 1.
      • Top As Int
      • Url As String [read only]
        Gets the URL for the current page.
        Added in API level 1.
      • URLUtil As UltimateURLUtil
        Gets or sets UltimateURLUtil methods and properties. Class is auto initialized.
      • View As View [read only]
        Get UltimateWebView as android.view.View.
      • Visible As Boolean
      • WebChromeClientEnabled As Boolean
        Enable or Disable chrome handler. This is an implementation of WebChromeClient for use in handling JavaScript dialogs, favicons, titles, and the progress.
        Library will initialize WebChromeClient by itself and associate it with UltimateWebView.
        Online file upload option will be enabled by default.
        Geolocation permission will be handled like any other permission request and will trigger PermissionRequest event.
        Added in API level 1.
      • WebView As WebView [read only]
        Gets native B4A WebView which is auto associated with UltimateWebView.
      • WebViewClientEnabled As Boolean
        Enable or Disable WebViewClient that will receive various notifications and requests.
        Library will initialize WebViewCliect by itself and associate it with UltimateWebView.
        Added in API level 1.
      • Width As Int
  • UltimateWebViewConstants
    • Fields:
      • CACHEMODE_LOAD_CACHE_ELSE_NETWORK As Int
      • CACHEMODE_LOAD_CACHE_ONLY As Int
      • CACHEMODE_LOAD_DEFAULT As Int
      • CACHEMODE_LOAD_NO_CACHE As Int
      • FORCE_DARK_AUTO As Int
      • FORCE_DARK_OFF As Int
      • FORCE_DARK_ON As Int
      • MENU_ITEM_NONE As Int
      • MENU_ITEM_PROCESS_TEXT As Int
      • MENU_ITEM_SHARE As Int
      • MENU_ITEM_WEB_SEARCH As Int
      • MIXED_CONTENT_ALWAYS_ALLOW As Int
      • MIXED_CONTENT_COMPATIBILITY_MODE As Int
      • MIXED_CONTENT_NEVER_ALLOW As Int
      • OVER_SCROLL_ALWAYS As Int
      • OVER_SCROLL_IF_CONTENT_SCROLLS As Int
      • OVER_SCROLL_NEVER As Int
      • RENDERER_PRIORITY_BOUND As Int
      • RENDERER_PRIORITY_IMPORTANT As Int
      • RENDERER_PRIORITY_WAIVED As Int
      • SCROLLBAR_POSITION_DEFAULT As Int
      • SCROLLBAR_POSITION_LEFT As Int
      • SCROLLBAR_POSITION_RIGHT As Int
      • SCROLLBARS_INSIDE_INSET As Int
      • SCROLLBARS_INSIDE_OVERLAY As Int
      • SCROLLBARS_OUTSIDE_INSET As Int
      • SCROLLBARS_OUTSIDE_OVERLAY As Int
    • Functions:
      • Initialize As String
        Initializes the object.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
  • UltimateWebViewSettings
    • Functions:
      • ImportSettingsFrom (From As UltimateWebView) As String
        Import settings from other UltimateWebView without referencing.
      • Initialize (UltimateWebView1 As UltimateWebView) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
    • Properties:
      • AllowContentAccess As Boolean
        Enables or disables content URL access within UltimateWebView.
        Added in API level 11.
      • AllowFileAccess As Boolean
        Enables or disables file access within UltimateWebView.
        Added in API level 3.
      • AllowFileAccessFromFileURLs As Boolean
        Added in API level 16.
        This method was deprecated in API level 30. This setting is not secure.
      • AllowUniversalAccessFromFileURLs As Boolean
        Added in API level 16.
        This method was deprecated in API level 30. This setting is not secure.
      • AppCacheEnabled As Boolean
        Added in API level 7.
        This method was deprecated in API level 30. The Application Cache API is deprecated and this method will become a no-op on all Android versions once support is removed in Chromium. Consider using Service Workers instead. See https://web.dev/appcache-removal/ for more information.
      • AppCacheMaxSize As Long
        Added in API level 7.
        Value in bytes. This method was deprecated in API level 18. Quota is managed automatically; this method is a no-op.
      • AppCachePath As String
        Added in API level 7.
        This method was deprecated in API level 30. The Application Cache API is deprecated and this method will become a no-op on all Android versions once support is removed in Chromium. Consider using Service Workers instead. See https://web.dev/appcache-removal/ for more information.
      • BlockNetworkImage As Boolean
        Sets whether the WebView should not load image resources from the network (resources accessed via http and https URI schemes).
        Added in API level 1.
      • BlockNetworkLoads As Boolean
        Sets whether the WebView should not load resources from the network.
        Added in API level 8.
      • BuiltInZoomControls As Boolean
        Sets whether the WebView should use its built-in zoom mechanisms.
        Added in API level 3.
      • CacheMode As Int
        Overrides the way the cache is used. Values: CACHEMODE_LOAD_DEFAULT, CACHEMODE_LOAD_CACHE_ELSE_NETWORK, CACHEMODE_LOAD_NO_CACHE and CACHEMODE_LOAD_CACHE_ONLY=3.
        Added in API level 1.
      • Constants As UltimateWebViewConstants [read only]
      • CursiveFontFamily As String
        Sets the cursive font family name.
        Added in API level 1.
      • DatabaseEnabled As Boolean
        Sets whether the database storage API is enabled.
        Added in API level 5.
      • DatabasePath As String
        Added in API level 5.
        This method was deprecated in API level 19. Database paths are managed by the implementation and calling this method will have no effect.
      • DefaultFixedFontSize As Int
        Sets the default fixed font size.
        Added in API level 1.
      • DefaultFontSize As Int
        Sets the default font size.
        Added in API level 1.
      • DefaultTextEncodingName As String
        Sets the default text encoding name to use when decoding html pages. The default is "UTF-8".
        Added in API level 1.
      • DisabledActionModeMenuItems As Int
        Disables the action mode menu items according to menuItems flag. Values: MENU_ITEM_NONE, MENU_ITEM_SHARE, MENU_ITEM_WEB_SEARCH or MENU_ITEM_PROCESS_TEXT.
        Added in API level 24.
      • DisplayZoomControls As Boolean
        Sets whether the UltimateWebView should display on-screen zoom controls when using the built-in zoom mechanisms.
        Added in API level 11.
      • DomStorageEnabled As Boolean
        Sets whether the DOM storage API is enabled.
        Added in API level 7.
      • EnableSmoothTransition As Boolean
        This method was deprecated in API level 17. This method is now obsolete, and will become a no-op in future.
        Added in API level 11.
      • FantasyFontFamily As String
        Sets the fantasy font family name.
        Added in API level 1.
      • FixedFontFamily As String
        Sets the fixed font family name.
        Added in API level 1.
      • ForceDark As Int
        Set the force dark mode for this UltimateWebView.
        Values (FORCE_DARK_OFF=0, FORCE_DARK_AUTO=1, FORCE_DARK_ON=2)
        Added in API level 29.
      • GeolocationDatabasePath As String
        This method was deprecated in API level 24. Geolocation database are managed by the implementation and calling this method will have no effect.
        Added in API level 5.
      • GeolocationEnabled As Boolean
        Sets whether Geolocation is enabled. Permissions in manifest: Manifest.permission.ACCESS_COARSE_LOCATION and Manifest.permission.ACCESS_FINE_LOCATION.
        Added in API level 5.
      • HorizontalFadingEdgeEnabled As Boolean
        Define whether the horizontal edges should be faded when this view is scrolled horizontally.
        Added in API level 1.
      • HorizontalScrollBarEnabled As Boolean
        Define whether the horizontal scrollbar should be drawn or not.
        Added in API level 1.
      • HorizontalScrollBarThumbColor As Int [write only]
        Defines the horizontal thumb color.
        Added in API level 29.
      • HorizontalScrollBarTrackColor As Int [write only]
        Defines the horizontal track color.
        Added in API level 29.
      • JavaScriptCanOpenWindowsAutomatically As Boolean
        Allow JavaScript to open windows automatically.
        Added in API level 1.
      • JavaScriptEnabled As Boolean
        Tells the UltimateWebView to enable JavaScript execution.
        Added in API level 1.
      • LightTouchEnabled As Boolean
        This method was deprecated in API level 18. From Build.VERSION_CODES.JELLY_BEAN this setting is obsolete and has no effect.
        Added in API level 1.
      • LoadsImagesAutomatically As Boolean
        Sets whether the UltimateWebView should load image resources.
        Added in API level 1.
      • LoadWithOverviewMode As Boolean
        Sets whether the UltimateWebView loads pages in overview mode, that is, zooms out the content to fit on screen by width.
        Added in API level 7.
      • MediaPlaybackRequiresUserGesture As Boolean
        Sets whether the UltimateWebView requires a user gesture to play media.
        Added in API level 17.
      • MinimumFontSize As Int
        Sets the minimum font size.
        Added in API level 1.
      • MinimumLogicalFontSize As Int
        Sets the minimum logical font size.
        Added in API level 1.
      • MixedContentMode As Int
        Configures the UltimateWebView's behavior when a secure origin attempts to load a resource from an insecure origin.
        Values (MIXED_CONTENT_ALWAYS_ALLOW=0, MIXED_CONTENT_NEVER_ALLOW=1, MIXED_CONTENT_COMPATIBILITY_MODE=2).
        Added in API level 21.
      • NeedInitialFocus As Boolean
        Tells the UltimateWebView whether it needs to set a node to have focus when WebView#requestFocus(int, android.graphics.Rect) is called.
        Added in API level 1.
      • OffscreenPreRaster As Boolean
        Sets whether this UltimateWebView should raster tiles when it is offscreen but attached to a window.
        Added in API level 23.
      • SafeBrowsingEnabled As Boolean
        Sets whether Safe Browsing is enabled.
        Added in API level 26.
      • SansSerifFontFamily As String
        Sets the sans-serif font family name.
        Added in API level 1.
      • SaveFormData As Boolean
        This method was deprecated in API level 26. In Android O and afterwards, this function does not have any effect, the form data will be saved to platform's autofill service if applicable.
        Added in API level 1.
      • SavePassword As Boolean
        This method was deprecated in API level 18. Saving passwords in WebView will not be supported in future versions.
        Added in API level 1.
      • ScrollBarDefaultDelayBeforeFade As Int
        Define the delay in milliseconds before scrollbars fade.
        Added in API level 16.
      • ScrollBarFadeDuration As Int
        Define the scrollbar fade duration in milliseconds.
        Added in API level 16.
      • ScrollBarFadingEnabled As Boolean
        Define whether scrollbars will fade when the view is not scrolling.
        Added in API level 5.
      • ScrollBarSize As Int
        Define the scrollbar size in dip.
        Added in API level 16.
      • ScrollBarStyle As Int [write only]
        Specify the style of the scrollbars.
        Values: For example, if a view has a background drawable and you want to draw the scrollbars inside the padding specified by the drawable, you can use SCROLLBARS_INSIDE_OVERLAY or SCROLLBARS_INSIDE_INSET. If you want them to appear at the edge of the view, ignoring the padding, then you can use SCROLLBARS_OUTSIDE_OVERLAY or SCROLLBARS_OUTSIDE_INSET.
        Added in API level 1.
      • SerifFontFamily As String
        Sets the serif font family name.
        Added in API level 1.
      • StandardFontFamily As String
        Sets the standard font family name.
        Added in API level 1.
      • SupportMultipleWindows As Boolean
        Sets whether the UltimateWebView whether supports multiple windows.
        Added in API level 1.
      • SupportZoom As Boolean
        Sets whether the UltimateWebView should support zooming using its on-screen zoom controls and gestures.
        Added in API level 1.
      • TextZoom As Int
        Sets the text zoom of the page in percent.
        Added in API level 14.
      • UserAgentString As String
        Sets the UltimateWebView's user-agent string.
        Added in API level 3.
      • UseWideViewPort As Boolean
        Sets whether the UltimateWebView should enable support for the "viewport" HTML meta tag or should use a wide viewport.
        Added in API level 1.
      • VerticalFadingEdgeEnabled As Boolean
        Define whether the vertical edges should be faded when this view is scrolled vertically.
        Added in API level 1.
      • VerticalScrollBarEnabled As Boolean
        Define whether the vertical scrollbar should be drawn or not.
        Added in API level 1.
      • VerticalScrollBarPosition As Int [write only]
        Set the position of the vertical scroll bar. Should be one of SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT or SCROLLBAR_POSITION_RIGHT.
        Added in API level 11.
      • VerticalScrollBarThumbColor As Int [write only]
        Defines the vertical scrollbar thumb color.
        Added in API level 29.
      • VerticalScrollBarTrackColor As Int [write only]
        Defines the vertical scrollbar track color.
        Added in API level 29.
  • WebBackForwardList
    • Functions:
      • GetItemAtIndex (Index As Int) As WebHistoryItem
        Get the history item at the given index.
        Added in API level 1.
      • Initialize (UltimateWebView1 As UltimateWebView) As String
        Initializes the object.
        Added in API level 1.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • toList As List
        Convrets object to List Of WebHistoryItem
      • toObject As Object
        Returns Object as android.webkit.WebBackForwardList which can be used in Java Code.
    • Properties:
      • CurrentIndex As Int [read only]
        Get the index of the current history item.
        Added in API level 1.
      • CurrentItem As WebHistoryItem [read only]
        Return the current history item.
        Added in API level 1.
      • Size As Int [read only]
        Get the total size of the back/forward list.
        Added in API level 1.
  • WebHistoryItem
    • Fields:
      • Favicon As Bitmap
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • OriginalUrl As String
      • Title As String
      • Url As String
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • WebResourceError
    • Functions:
      • Initialize (JavaWebResourceError As Object) As String
        Initializes the object.
        Added in API level 23.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • toObject As Object
        Returns Object as android.webkit.WebResourceError which can be used in Java Code.
        Added in API level 23.
    • Properties:
      • Description As String [read only]
        Gets the string describing the error.
        Added in API level 23.
      • ErrorCode As Int [read only]
        Gets the error code of the error.
        Added in API level 23.
  • WebResourceRequest
    • Functions:
      • Initialize (JavaWebResourceRequest As Object) As String
        Initializes the object.
        Added in API level 21.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • toObject As Object
        Returns Object as android.webkit.WebResourceRequest which can be used in Java Code.
        Added in API level 21.
    • Properties:
      • GetMethod As String [read only]
        Gets the method associated with the request, for example "GET".
        Added in API level 21.
      • GetRequestHeaders As Map [read only]
        Gets the headers associated with the request.
        Added in API level 21.
      • GetUrl As String [read only]
        Gets the URL for which the resource request was made.
        Added in API level 21.
      • HasGesture As Boolean [read only]
        Gets whether a gesture (such as a click) was associated with the request.
        Added in API level 21.
      • IsForMainFrame As Boolean [read only]
        Gets whether the request was made in order to fetch the main frame's document.
        Added in API level 21.
      • IsRedirect As Boolean [read only]
        Gets whether the request was a result of a server-side redirect.
        Added in API level 24.
  • WebResourceResponse
    • Functions:
      • Create (MimeType As String, Encoding As String, Data As InputStream) As String
        Constructs a resource response with the given MIME type, character encoding, and input stream.
        MimeType As String - the resource response's MIME type, for example "text/html".
        Encoding As String - the resource response's character encoding, for example "utf-8".
        Data As InputStream - the input stream that provides the resource response's data.
        Added in API level 11.
      • Create2 (MimeType As String, Encoding As String, StatusCode As Int, ReasonPhrase As String, ResponseHeaders As Map, Data As InputStream) As String
        Constructs a resource response with the given parameters.
        MimeType As String - the resource response's MIME type, for example "text/html".
        Encoding As String - the resource response's character encoding, for example "utf-8".
        StatusCode As Int - the status code needs to be in the ranges [100, 299], [400, 599]. Causing a redirect by specifying a 3xx code is not supported.
        ReasonPhrase As String - the phrase describing the status code, for example "OK". Must be non-empty. This value cannot be null.
        ResponseHeaders As Map - the resource response's headers represented as a mapping of header name -> header value.
        Data As InputStream - the input stream that provides the resource response's data.
        Added in API level 21.
      • Create3 (JavaWebResourceResponse As Object) As String
        Constructs a resource from android.webkit.WebResourceResponse generated in Java Code.
        Added in API level 11.
      • Initialize As String
        Initializes the object. Empty WebResourceResponse is created.
        Use Create methods to create with parameters.
        Added in API level 11.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • StatusCodeAndReasonPhrase (StatusCode As Int, ReasonPharse As String) As String
        Sets the resource response's status code and reason phrase.
        StatusCode As Int - the status code needs to be in the ranges [100, 299], [400, 599]. Causing a redirect by specifying a 3xx code is not supported.
        ReasonPharse As String - the phrase describing the status code, for example "OK". Must be non-empty. This value cannot be Null.
        Added in API level 21.
      • toObject As Object
        Returns Object as android.webkit.WebResourceResponse which can be used in Java Code.
        Added in API level 11.
    • Properties:
      • Data As InputStream
        Gets or sets the input stream that provides the resource response's data.
        Added in API level 11.
      • Encoding As String
        Gets or sets the resource response's encoding.
        Added in API level 11.
      • MimeType As String
        Gets or sets the resource response's MIME type.
        Added in API level 11.
      • ReasonPhrase As String [read only]
        Gets the description of the resource response's status code.
        Added in API level 21.
      • ResponseHeaders As Map
        Gets or sets the headers for the resource response.
        Added in API level 21.
      • StatusCode As Int [read only]
        Gets the resource response's status code.
        Added in API level 21.



If this library makes your work easier and saves time in creating your application, please make a donation.
 

Attachments

  • B4AExample.zip
    13.1 KB · Views: 213
  • UltimateWebView_2.12_Lib&Doc.zip
    118.1 KB · Views: 228
Last edited:

Ivica Golubovic

Active Member
Licensed User
very good.
again error on load layout.
but error change.

B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 33 (Main)
java.lang.RuntimeException: Cannot parse: null as boolean
    at anywheresoftware.b4a.BA.parseBoolean(BA.java:629)
    at anywheresoftware.b4a.BA.ObjectToBoolean(BA.java:699)
    at com.uwebview.ultimatewebview._afterloadlayout(ultimatewebview.java:302)
    at com.uwebview.ultimatewebview.callSub(ultimatewebview.java:3061)
    at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1066)
    at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1037)
    at com.uwebview.ultimatewebview._designercreateview(ultimatewebview.java:835)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:61)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at com.test.net.main._activity_create(main.java:392)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at com.test.net.main.afterFirstLayout(main.java:105)
    at com.test.net.main.access$000(main.java:17)
    at com.test.net.main$WaitForLayout.run(main.java:83)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5293)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
** Activity (main) Resume **
Try version 2.01. Problem fixed.
 

Ivica Golubovic

Active Member
Licensed User
no.not work
Sorry man, it's my fault. I forgot to put in a new B4AExample project after some system stuff related to Custom View properties was replaced in the library. The problem in B4AExample has been solved by deleting the UltimateWebView object through the designer and adding a new one. Get the new B4AExample from first post. Thanks again for pointing me to the problem.
 

LucaMs

Expert
Licensed User
Longtime User
Can I suggest that you move the description - the motivation that led you to develop this library - to the beginning of the thread, rather than after the very long list of its members? :)
 

Ivica Golubovic

Active Member
Licensed User
Can I suggest that you move the description - the motivation that led you to develop this library - to the beginning of the thread, rather than after the very long list of its members? :)
Okay, thank you for the useful advice. I will consider how to redesign the first post because the references are really very long. Maybe I'll remove the references from the first post.
 

Ivica Golubovic

Active Member
Licensed User
Version 2.1 released. Download library and documents from first post.

Changes:
  • Added method LoadHTMLString (HTMLString As String) to UltimateWebView class.
  • Edited event OnUnhandledKeyEvent (KeyCode As Int, AndroidViewKeyEvent As Object) 'Works from API level 1 to API level 21. WebViewClient required.
  • Added event OnUnhandledKeyEvent2 (KeyCode As Int, AndroidViewKeyEvent As Object) As Boolean 'Works from API level 28 and above.
  • Edited event OverrideUrl (Url As String) As Boolean 'Works from API level 1 to API level 23. WebViewClient required.
  • Added event OverrideUrl2 (WebResourceRequest1 As WebResourceRequest) As Boolean 'Works from API level 24 and above. WebViewClient required.
  • Edited event OverrideUrlWithExternalAppIntent (Url As String, ExternalAppIntent As Intent) As Boolean 'Works from API level 1 to API level 23. WebViewClient required.
  • Added event OverrideUrlWithExternalAppIntent2 (WebResourceRequest1 As WebResourceRequest, ExternalAppIntent As Intent) As Boolean 'Works from API level 24 and above. WebViewClient required.
  • Edited event ReceivedError (ErrorCode As Int, Description As String, FailingUrl As String) 'Works from API level 1 to API level 23. WebViewClient required.
  • Added event ReceivedError2 (WebResourceRequest1 As WebResourceRequest, WebResourceError1 as WebResourceError) 'Works from API level 23 and above. WebViewClient required.
 

Apip Bayok

Member
very good.
again error on load layout.
but error change.

B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 33 (Main)
java.lang.RuntimeException: Cannot parse: null as boolean
    at anywheresoftware.b4a.BA.parseBoolean(BA.java:629)
    at anywheresoftware.b4a.BA.ObjectToBoolean(BA.java:699)
    at com.uwebview.ultimatewebview._afterloadlayout(ultimatewebview.java:302)
    at com.uwebview.ultimatewebview.callSub(ultimatewebview.java:3061)
    at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1066)
    at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1037)
    at com.uwebview.ultimatewebview._designercreateview(ultimatewebview.java:835)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:61)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at com.test.net.main._activity_create(main.java:392)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at com.test.net.main.afterFirstLayout(main.java:105)
    at com.test.net.main.access$000(main.java:17)
    at com.test.net.main$WaitForLayout.run(main.java:83)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5293)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
** Activity (main) Resume **
still face this error, UltimateWebView v2.10 device android 11, when I remove ultimatewebview object on designer and try to add new one it's not show on the list.
 

Ivica Golubovic

Active Member
Licensed User
still face this error, UltimateWebView v2.10 device android 11, when I remove ultimatewebview object on designer and try to add new one it's not show on the list.
Very strange, I tested on Android 11, 10, 9, 7 and 6 and it works without problems. I'll check again to see what could be causing the problem. Have you tried downloading the new B4AExample and uninstalling the old one before installing?
 

Ivica Golubovic

Active Member
Licensed User
Version 2.12 released. Download library and documents from first post.

Changes:
  • Edited method LoadHTMLString (HTMLString As String)
    • Fixed a bug that in some cases this method did not display the contents of the HTML string.
  • Edited method LoadFileFromDirAssets (FileName As String, IncludeSubFolders As Boolean)
    • IncludeSubFolders As Boolean - True for an html file whose objects are in a subfolder or multiple subfolders. False for an html file that has no additional objects in the subfolders but only at the root of the Asset folder. For a non html files value is not important (True or False).
    • It is now possible to use the standard file scheme to open files in subfolders through an HTML file. E.g:
    • Example::
      "file:///android_asset/subfolder/file.png"
  • Method SetWebChromeClient become property WebChromeClientEnabled (true or false).
    • B4X:
      UltimateWebView1.SetWebChromeClient  'old
      'Replace with
      UltimateWebView1.WebChromeClientEnabled=True 'or False for disable
  • Method SetWebViewClient become property WebViewClientEnabled (true or false).
    • B4X:
      UltimateWebView1.SetWebViewClient  'old
      'Replace with
      UltimateWebView1.WebViewClientEnabled=True 'or False for disable
  • Method SetDownloadListener become property DownloadListenerEnabled (true or false).
    • B4X:
      UltimateWebView1.SetDownloadListener  'old
      'Replace with
      UltimateWebView1.DownloadListenerEnabled=True 'or False for disable
  • The method FileChooserStart (for file upload) now starts the application chooser instead of the default file chooser.
 

max123

Active Member
Licensed User
Hi @Ivica Golubovic, you know because initializing JSInterface inside a Class this way fails?
B4X:
JSInterface.Initialize(Me)

I still search to port this @stevel05 library to B4A but app crashes on this line.
https://www.b4x.com/android/forum/threads/codemirror-wrapper-and-example.125775/

Log do not help, just says: Error occurred on line: 147 (CodeMirrorWrapper)

Many Thanks

Here the unfiltered log, for sure you are better than me to know it.
Logger connesso a: asus Nexus 7
--------- beginning of main
ClassLoader referenced unknown path: /data/app/b4a.example.codemirror-2/lib/arm
Starting remote logger. Port: 9638
Use EGL_SWAP_BEHAVIOR_PRESERVED: true
<qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb
Initialized EGL, version 1.4
*** Debugger waiting for connection (0) ***
0xaeef6000 Launching thread(s), CPUs 4
After accept
*** Debugger waiting for connection (1) ***
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Class not found: b4a.example.codeeditor, trying: b4a.example.codemirror.codeeditor
Class not found: b4a.example.codemirrorwrapper, trying: b4a.example.codemirror.codemirrorwrapper
Class not found: b4a.example.b4xplusminus, trying: b4a.example.codemirror.b4xplusminus
File.DirInternal: /data/user/0/b4a.example.codemirror/files
XUI.DefaultFolder: /data/user/0/b4a.example.codemirror/files
Background sticky concurrent mark sweep GC freed 35167(1606KB) AllocSpace objects, 1(40KB) LOS objects, 25% free, 8MB/11MB, paused 701us total 135.650ms
Loading com.google.android.webview version 99.0.4844.88 (code 484408800)
Loaded version=99.0.4844.88 minSdkVersion=23 isBundle=true multiprocess=false packageId=2
Successfully loaded native library
Flushed 9 samples from 9 histograms.
[WARNING:dns_config_service_android.cc(114)] Failed to read DnsConfig.
Skipped 43 frames! The application may be doing too much work on its main thread.
ignoring event: onlayoutchangelistener_event
validate_display:255 error 3008 (EGL_BAD_DISPLAY)
validate_display:255 error 3008 (EGL_BAD_DISPLAY)
Error occurred on line: 147 (CodeMirrorWrapper) <<<<<<<<<<<<<<<<<<<< ERROR HERE
java.lang.ClassNotFoundException: tils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currenttheme=
, filesfolder=/data/user/0/b4a.example.codemirror/files, jsinterface=[device=anywheresoftware.b4a.phone.Phone@aae679d, jsinterfacejo=(JavaObject) Not initialized, mcallback=[cmw_utils=null, code=, currentth
Message longer than Log limit (4000). Message was truncated.
java.net.SocketException: Socket closed
at libcore.io.Posix.recvfromBytes(Native Method)
at libcore.io.Posix.recvfrom(Posix.java:189)
at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:250)
at libcore.io.IoBridge.recvfrom(IoBridge.java:549)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:481)
at java.net.PlainSocketImpl.-wrap0(PlainSocketImpl.java)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
at java.io.InputStream.read(InputStream.java:162)
at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:149)
at java.io.BufferedInputStream.read(BufferedInputStream.java:234)
at anywheresoftware.b4a.shell.ShellConnector.readControlData(ShellConnector.java:191)
at anywheresoftware.b4a.shell.ShellConnector.connect(ShellConnector.java:186)
at anywheresoftware.b4a.shell.ShellConnector.run(ShellConnector.java:119)
at java.lang.Thread.run(Thread.java:818)
System.exit called, status: 0
VM exiting with result code 0, cleanup skipped.
ClassLoader referenced unknown path: /data/app/b4a.example.codemirror-2/lib/arm
Starting remote logger. Port: 9638
After accept
Use EGL_SWAP_BEHAVIOR_PRESERVED: true
<qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb
Initialized EGL, version 1.4
*** Debugger waiting for connection (0) ***
0xab49d000 Launching thread(s), CPUs 4
*** Debugger waiting for connection (1) ***
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Class not found: b4a.example.codeeditor, trying: b4a.example.codemirror.codeeditor
Class not found: b4a.example.codemirrorwrapper, trying: b4a.example.codemirror.codemirrorwrapper
Class not found: b4a.example.b4xplusminus, trying: b4a.example.codemirror.b4xplusminus
File.DirInternal: /data/user/0/b4a.example.codemirror/files
XUI.DefaultFolder: /data/user/0/b4a.example.codemirror/files
wrapper.css already exists
Updating version.txt (Copy from Assets)
Loading com.google.android.webview version 99.0.4844.88 (code 484408800)
Loaded version=99.0.4844.88 minSdkVersion=23 isBundle=true multiprocess=false packageId=2
Successfully loaded native library
Flushed 9 samples from 9 histograms.
[WARNING:dns_config_service_android.cc(114)] Failed to read DnsConfig.
Background partial concurrent mark sweep GC freed 28082(1481KB) AllocSpace objects, 3(60KB) LOS objects, 39% free, 9MB/16MB, paused 9.307ms total 48.370ms
Skipped 33 frames! The application may be doing too much work on its main thread.
ignoring event: onlayoutchangelistener_event
validate_display:255 error 3008 (EGL_BAD_DISPLAY)
validate_display:255 error 3008 (EGL_BAD_DISPLAY)
java.net.SocketException: Socket closed
at libcore.io.Posix.recvfromBytes(Native Method)
at libcore.io.Posix.recvfrom(Posix.java:189)
at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:250)
at libcore.io.IoBridge.recvfrom(IoBridge.java:549)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:481)
at java.net.PlainSocketImpl.-wrap0(PlainSocketImpl.java)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
at java.io.InputStream.read(InputStream.java:162)
at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:149)
at java.io.BufferedInputStream.read(BufferedInputStream.java:234)
at anywheresoftware.b4a.shell.ShellConnector.readControlData(ShellConnector.java:191)
at anywheresoftware.b4a.shell.ShellConnector.connect(ShellConnector.java:186)
at anywheresoftware.b4a.shell.ShellConnector.run(ShellConnector.java:119)
at java.lang.Thread.run(Thread.java:818)
java.net.SocketException: Socket closed
at libcore.io.Posix.recvfromBytes(Native Method)
at libcore.io.Posix.recvfrom(Posix.java:189)
at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:250)
at libcore.io.IoBridge.recvfrom(IoBridge.java:549)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:481)
at java.net.PlainSocketImpl.-wrap0(PlainSocketImpl.java)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
at java.io.InputStream.read(InputStream.java:162)
at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:149)
at java.io.BufferedInputStream.read(BufferedInputStream.java:234)
at anywheresoftware.b4a.shell.ShellConnector.readControlData(ShellConnector.java:191)
at anywheresoftware.b4a.shell.ShellConnector.connect(ShellConnector.java:186)
at anywheresoftware.b4a.shell.ShellConnector.run(ShellConnector.java:119)
at java.lang.Thread.run(Thread.java:818)
 
Last edited:

Ivica Golubovic

Active Member
Licensed User
Hi @Ivica Golubovic, you know because initializing JSInterface inside a Class this way fails?
B4X:
JSInterface.Initialize(Me)

I still search to port this @stevel05 library to B4A but compilation crashes on this line.
https://www.b4x.com/android/forum/threads/codemirror-wrapper-and-example.125775/

Log do not help, just says: Error occurred on line: 147 (CodeMirrorWrapper)

Many Thanks

Here the filtered log, for sure you are better than me to know it.
Please share the part of code, I am not sure that I unerstand you...
 

max123

Active Member
Licensed User
Thanks for reply,

maybe I found a mistake, I used this line in the DesignerCreateView where @stevel05 initialized a B4J Javascript using JavaObject and webEngine. Maybe don't like it?

What I do not know is because the UltimateWebView can be initialized with Me but JSInterface no.

Here a relevant code...
If you need I can send all class.

Many thanks

B4X:
In Class_Globals:  Public JSInterface As UltimateJavascriptInterface

Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)

    mBase = Base
    Tag = mBase.Tag
 
    'Initial Values
    mWidth = mBase.Width
    mHeight = mBase.Height

    mBase.LoadLayout("codemirrorwrapper")
 
    mBase.Tag = Me
 
    ''''''''''''''''''''''''''''' SETUP B4J JS '''''''''''''''''''''''''''''''
''''''''''''    WebE = WebEngine_Static.New(WebView1)
 
''''''''''''    WebE.SetOnAlert(Me,"JSAlert")
''''''''''''    WebE.SetOnError(Me,"JSError")
 
'''''''    B4xCalls.Initialize
'''''''    RegisterB4XCall("JsLog",Me,"Js_Log")
'''''''    RegisterB4XCall("codechanged",mCallBack,mEventName & "_CodeChanged")
 
''''''''''    WebE.AddWorkerListener(Me,"LoadProgress")
    ''''''''''''''''''''''''''''''''''''

'''''''''''''''''''''''''''''''''''' SETUP B4A JS ''''''''''''''''''''''''''''''''''''
    UltimateWebView1.Initialize(Me, "UltimateWebView1")
'    UltimateWebView1.SetWebViewClient(True) 'Sets WebViewClient and its Events.
    UltimateWebView1.SetWebChromeClient(True) 'Sets WebChromeClient and its Events.
 
    'Other UltimateWebViewSettings
    UltimateWebView1.Settings.JavaScriptEnabled = True
    UltimateWebView1.Settings.JavaScriptCanOpenWindowsAutomatically = True
    UltimateWebView1.Settings.DisplayZoomControls = False
 
'    UltimateWebView1.Settings.AllowContentAccess = True
'    UltimateWebView1.Settings.AllowFileAccess = True
'    UltimateWebView1.Settings.AppCacheEnabled = True
'    UltimateWebView1.Settings.CacheMode = UltimateWebView1.Settings.Constants.CACHEMODE_LOAD_DEFAULT
'    UltimateWebView1.Settings.DomStorageEnabled = True
'    UltimateWebView1.Settings.MediaPlaybackRequiresUserGesture = False
'    UltimateWebView1.Settings.AllowFileAccessFromFileURLs = True
'    UltimateWebView1.Settings.AllowUniversalAccessFromFileURLs = True
'    UltimateWebView1.SetDownloadListener 'Sets and start DownloadListener'
 
    Log("InitMe=" & Me)
 
    JSInterface.Initialize(Me)   ' <<<<<<<  ERROR HERE
    '"B4A" is name of javascriptinterface. You can use different name if you want.
    UltimateWebView1.AddJavascriptInterface(JSInterface, "B4A")
 
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
End Sub
 
Last edited:

Ivica Golubovic

Active Member
Licensed User
Thanks for reply,

maybe I found a mistake, I used this line in the DesignerCreateView where @stevel05 initialized a B4J Javascript using JavaObject and webEngine. Maybe don't like it?

Here a relevant code... What I do not know is because the UltimateWebView can be initialized with Me but JSInterface no.
If you need I can send all class.

Many thanks

B4X:
In Class_Globals:  Public JSInterface As UltimateJavascriptInterface

Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)

    mBase = Base
    Tag = mBase.Tag
 
    'Initial Values
    mWidth = mBase.Width
    mHeight = mBase.Height

    mBase.LoadLayout("codemirrorwrapper")
 
    mBase.Tag = Me
 
    ''''''''''''''''''''''''''''' SETUP B4J JS '''''''''''''''''''''''''''''''
''''''''''''    WebE = WebEngine_Static.New(WebView1)
 
''''''''''''    WebE.SetOnAlert(Me,"JSAlert")
''''''''''''    WebE.SetOnError(Me,"JSError")
 
'''''''    B4xCalls.Initialize
'''''''    RegisterB4XCall("JsLog",Me,"Js_Log")
'''''''    RegisterB4XCall("codechanged",mCallBack,mEventName & "_CodeChanged")
 
''''''''''    WebE.AddWorkerListener(Me,"LoadProgress")
    ''''''''''''''''''''''''''''''''''''

'''''''''''''''''''''''''''''''''''' SETUP B4A JS ''''''''''''''''''''''''''''''''''''
    UltimateWebView1.Initialize(Me, "UltimateWebView1")
'    UltimateWebView1.SetWebViewClient(True) 'Sets WebViewClient and its Events.
    UltimateWebView1.SetWebChromeClient(True) 'Sets WebChromeClient and its Events.
 
    'Other UltimateWebViewSettings
    UltimateWebView1.Settings.JavaScriptEnabled = True
    UltimateWebView1.Settings.JavaScriptCanOpenWindowsAutomatically = True
    UltimateWebView1.Settings.DisplayZoomControls = False
 
'    UltimateWebView1.Settings.AllowContentAccess = True
'    UltimateWebView1.Settings.AllowFileAccess = True
'    UltimateWebView1.Settings.AppCacheEnabled = True
'    UltimateWebView1.Settings.CacheMode = UltimateWebView1.Settings.Constants.CACHEMODE_LOAD_DEFAULT
'    UltimateWebView1.Settings.DomStorageEnabled = True
'    UltimateWebView1.Settings.MediaPlaybackRequiresUserGesture = False
'    UltimateWebView1.Settings.AllowFileAccessFromFileURLs = True
'    UltimateWebView1.Settings.AllowUniversalAccessFromFileURLs = True
'    UltimateWebView1.SetDownloadListener 'Sets and start DownloadListener'
 
    Log("InitMe=" & Me)
 
    JSInterface.Initialize(Me)   ' <<<<<<<  ERROR HERE
    '"B4A" is name of javascriptinterface. You can use different name if you want.
    UltimateWebView1.AddJavascriptInterface(JSInterface, "B4A")
 
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
End Sub
First try not to initialize JSInterface to Designer sub. If that doesn't work, let me know so I can check the library code tomorrow.
 

max123

Active Member
Licensed User
Sorry, I don't known it, what is Designer sub ?

Maybe you intend inside a class initializer ?
B4X:
Public Sub Initialize (Callback As Object, EventName As String)
 
Top