B4A Library UltimateWebView Custom View

IMPORTANT!!!
Library deprecated. Use UltimateWebView2 instead.


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.

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

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

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

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

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

Library references htm file is packed together with jar and xml file.

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

iz0ndg

Active Member
Licensed User
Longtime User
It would not be bad to post your solution here because it might help someone with the same or a similar problem. Thanks.
Sure...

in Globals :
B4X:
Sub Globals
    ...
    Dim jo As JavaObject
End Sub

in Activity Create :
B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    ...
    If FirstTime Then
        jo.InitializeContext
    End If
    ...   
End Sub

One sub :
B4X:
Sub StringtoHtml(Stringa As String) As String
    Dim HtmlResult As String=jo.RunMethod("jsonToHtml",Array(Stringa))
    HtmlResult = HtmlResult.Replace($"\""$,$"""$).Replace($"\n"$,Chr(13))
    ' Replace \" with one " and \n with chr(13)  (New Line)
    Return HtmlResult
End Sub

And the Java code :
B4X:
#If Java
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import java.lang.StringBuffer;
import java.lang.Integer;

public String jsonToHtml (String data) {
        Pattern p = Pattern.compile("\\\\u(\\p{XDigit}{4})");
        Matcher m = p.matcher(data);
        StringBuffer buf = new StringBuffer(data.length());
        while (m.find()) {
            String ch = String.valueOf((char) Integer.parseInt(m.group(1), 16));
            m.appendReplacement(buf, Matcher.quoteReplacement(ch));
        }
        m.appendTail(buf);
        return buf.toString();
    }

#End If
 

Ivica Golubovic

Active Member
Licensed User
WebRTC.

Good afternoon,
I loaded the ultimatewebview control within a webpage (https://meet.jit.si/conference). The webrtc connection is perfectly established. Could I know when the user closes the conference? The address changes to https://meet.jit.si/static/close3.html

Thanks in advanced!!
If the address changes when the user closes the connection then it is possible to catch it via the "PageFinished" event as in the example below:
Example::
Sub UltimateWebView1_PageFinished (Url As String)
    If Url.Contains("meet.jit.si") And Url.Contains("close") Then
        'User closes connection
    End If
End Sub
 

Ivica Golubovic

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


Changes:

1.
Added class SafeBrowsingResponse.
Added the "SafeBrowsingResponse" class required for the "SafeBrowsingHit" event that is activated when the URL has been flagged by Safe Browsing.

2. Added event SafeBrowsingHit (WebResourceRequest1 As WebResourceRequest, SafeBrowsingResponse1 As SafeBrowsingResponse).

3. Added method SetRendererPriorityPolicy(RendererRequestedPriority As Int, WaivedWhenNotVisible As Boolean) to UltimateWebView class.
Examples:
Example::
UltimateWebView1.SetRendererPriorityPolicy(UltimateWebView1.Constants.RENDERER_PRIORITY_BOUND,True)
'Or
UltimateWebView1.SetRendererPriorityPolicy(UltimateWebView1.Constants.RENDERER_PRIORITY_IMPORTANT,True)
'Or
UltimateWebView1.SetRendererPriorityPolicy(UltimateWebView1.Constants.RENDERER_PRIORITY_WAIVED,True)

4. Added property AccessibilityClassName As String to UltimateWebView class.
This property returns a String that represents the class to which the object is bound. Example: android.webkit.WebView

5. Added property View As View to UltimateWebView class.
This property converts UltimateWebView to android.view.View which allows you to programmatically add this object to an activity or panel. Before that, of course, it is necessary to initialize the object.
Example::
Dim UWebView As UltimateWebView
UWebView.Initialize(Me,"UWebView")
Activity.AddView(UWebView.View,0,20%y,100%x,80%y)
'OR
Panel1.AddView(UWebView.View,0,20%y,100%x,80%y)

6. Added property SafeBrowsingPrivacyPolicyUrl As AndroidNetURI to UltimateWebView class.
You need to download my "AndroidNetUri" library from the link below:

7. Added event CreateChildWindow (IsDialog As Boolean, IsUserGesture As Boolean) As UltimateWebView
To enable this event you first need to add the following lines to "Sub Activity_Create (FirstTime As Boolean)":
Example::
UltimateWebView1.SetWebViewClient
UltimateWebView1.SetWebChromeClient
UltimateWebView1.Settings.SupportMultipleWindows=True
Many websites require a new interface (child view) to display some additional content. If you click on a certain button or link, those sites will not display content unless the content is transferred to child view. In this case, the "CreateChildWindow" event will be activated. The return object of the event is UltimateWebView which is defined by you. The library will continue to manage this object on its own, so DON'T add it to the activity. You can also add events for the newly created child view. If you do not want to allow the website to transfer content to a child view then return Null and page will not be loaded. If you do not want this event to be activated at all and to disable this feature on all sites, set Settings.SupportMultipleWindows to False.
Example::
Private Sub UltimateWebView1_CreateChildWindow (IsDialog As Boolean, IsUserGesture As Boolean) As UltimateWebView
    Log("Added New Child Window")
    'Return Null if you do not want to create child window. Page will not be loaded!
    Dim NewUltimateView As UltimateWebView
    NewUltimateView.Initialize(Me,"NewUltimateView")
    NewUltimateView.EnableSlowWholeDocumentDraw
    NewUltimateView.Settings=UltimateWebView1.Settings 'Import settings from main UltimateWebView
    NewUltimateView.SetWebViewClient
    NewUltimateView.SetWebChromeClient
    NewUltimateView.CookieManager.AcceptCookies=True
    NewUltimateView.CookieManager.AcceptFileSchemeCookies=True
    NewUltimateView.CookieManager.AcceptThirdPartyCookies=True
    NewUltimateView.CookieManager.Flush
    Return NewUltimateView 'Return created UltimateWebView like child window. Library will do the rest. You can initialize all needed events for this child.
End Sub

Sub NewUltimateView_PageFinished (Url As String)
    Log("ChildFinishedPage: " & Url)
End Sub

Sub NewUltimateView_OverrideUrl (WebResourceRequest1 As WebResourceRequest) As Boolean
    Log("OverridenChildUrl: " & WebResourceRequest1.GetUrl)
    Return False
End Sub

8. Added event RenderProcessGone (DidCrash As Boolean, RendererPriorityAtExit As Int)
This event will be triggered the moment an error occurs in rendering the selected content to prevent the UltimateWebView and the application from crashing. By default, the library will try to prevent the UltimateWebView and application to crash. Of course, if you want, you can exit the application yourself by executing the "ExitApplication" command in this event.
Example::
Private Sub UltimateWebView1_RenderProcessGone (DidCrash As Boolean, RendererPriorityAtExit As Int)
    Log(DidCrash)
    Log(RendererPriorityAtExit)
End Sub

9. Discovered bugs fixed
 

Ivica Golubovic

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

Changes:
  • Added class JsPromptResult
  • Added method PrintContent to UltimateWebView class
  • Added method FindFocus As View to UltimateWebView class
  • Added method ImportSettingsFrom (From As UltimateWebView) to UltimateWebViewSettings class
  • Added event JsPrompt (JsProperties1 As JsProperties, JsPromptResult1 As JsPromptResult) As Boolean
  • Added event OnFocusChange (HasFocus As Boolean)
  • Added event OnKeyEvent (KeyCode As Int, AndroidViewKeyEvent As Object) As Boolean
  • Added event OnLayoutChange (New As LayoutChangeProperties, Old As LayoutChangeProperties)
  • Added event OnScrollChange (New As ScrollChangeProperties, Old As ScrollChangeProperties)
  • Added event OnTouch (AndroidViewMotionEvent As Object) As Boolean
  • Added event OnUnhandledKeyEvent (KeyCode As Int, AndroidViewKeyEvent As Object) As Boolean
 

stevenindon

Active Member
Licensed User
Hello,

Nice!! A library that what i am waiting. Just 2 questions:

1) Is this cross platform? - Android / IOS
2) Does it have a function like in WebViewExtras - that we can call a B4A/B4i function from our web page?

B4X:
Example :  PBrowser.CallSub('Exec_App_Toastmessage',true,'This is a toast message','true');

Or even Call a B4a/B4i function from our webpage --> With a return value?

I have face a lot of problem programming in IOS having to use javascript to call functions inside B4A/B4i :

window.location='Exec[ExecReturn_http_ReqString|http://www.MyWeb.com|James|32]' and then catch the command word from
Sub WKWebView_OverrideUrl (Url As String) As Boolean

This library will be super valuable if it is cross platform (Android / IOS) as i see that you have put great great amount of work on this.
 
Last edited:

Ivica Golubovic

Active Member
Licensed User
Hello,

Nice!! A library that what i am waiting. Just 2 questions:

1) Is this cross platform? - Android / IOS
2) Does it have a function like in WebViewExtras - that we can call a B4A/B4i function from our web page?

B4X:
Example :  PBrowser.CallSub('Exec_App_Toastmessage',true,'This is a toast message','true');

Or even Call a B4a/B4i function from our webpage --> With a return value?

I have face a lot of problem programming in IOS having to use javascript to call functions inside B4A/B4i :

window.location='Exec[ExecReturn_http_ReqString|http://www.MyWeb.com|James|32]' and then catch the command word from
Sub WKWebView_OverrideUrl (Url As String) As Boolean

This library will be super valuable if it is cross platform (Android / IOS) as i see that you have put great great amount of work on this.
The answer to your first question is NO. The library is made only for android. At the moment, I have no plans to work on something similar for IOS. If someone has the time and will for such a project, I will be happy to provide assistance if needed.

As for your second question, it is possible if you create JavascriptInterface through java code and insert it into UltimateWebView via the AddJavaScriptInterface method. My plan is to implement several standard JS interfaces in one of the next versions of the library, including CallSub.
 

stevenindon

Active Member
Licensed User
Thank you Ivica. Most of the projects involves IOS as well.. That is the only reason i have to switch to native instead of Webview as current Webview in IOS still cant CallSub functions in application using javascript. I have done a project using Webview in both B4A and B4i ... and it is pain staking.
 

Ivica Golubovic

Active Member
Licensed User
Thank you Ivica. Most of the projects involves IOS as well.. That is the only reason i have to switch to native instead of Webview as current Webview in IOS still cant CallSub functions in application using javascript. I have done a project using Webview in both B4A and B4i ... and it is pain staking.
Okay, as you probably already know, this library is closely related to the android.webkit set of classes. Some parts have been rewritten and some have been reworked to make them easier to use. As for the iOS library, you have to know that there is a big difference between androd.webkit.WebView and WKWebView for IOS and it is very difficult to make a simple cross platform library. Besides, if you readed the first post, the main parts of this library were reworked from one of my projects (somewhere around 75%). I decided to make this library to make it easier for me to work on my future projects, and after that I decided to share it with this community as well. This library will save you hours of Java programming in your future projects for the Android platform. It's up to you to use it. Thanks.
 

Ivica Golubovic

Active Member
Licensed User
Hi
How properly use AddJavascriptInterface and CallSub from ultimatewebview?
In a few days, a new version of the library will be released, which will include the UltimateJavascriptInterface class, which will include CallSub, ShowToast, Log, StartActivity and Print methods. Wait a few days.
 

mzsoft

Member
Hi.
i just run example but on line LoadLayout this error show.

B4X:
Error occurred on line: 33 (Main)
java.lang.ClassNotFoundException: android$view$View$OnUnhandledKeyEventListener
    at anywheresoftware.b4j.object.JavaObject.getCorrectClassName(JavaObject.java:289)
    at anywheresoftware.b4j.object.JavaObject.createEvent(JavaObject.java:253)
    at anywheresoftware.b4j.object.JavaObject.CreateEvent(JavaObject.java:216)
    at com.uwebview.ultimatewebview._initialize(ultimatewebview.java:1000)
    at java.lang.reflect.Method.invoke(Native Method)
    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 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 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 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:148)
    at android.app.ActivityThread.main(ActivityThread.java:5530)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:734)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
 

Ivica Golubovic

Active Member
Licensed User
Hi.
i just run example but on line LoadLayout this error show.
The problem is because you are using the SDK library below version 28. Download the latest version of B4A and the latest SDK configuration file from the link below. Follow the instructions on how to configure B4A.

Are you using an emulator or a real device and which version of Android is on it?

 

mzsoft

Member
The problem is because you are using the SDK library below version 28. Download the latest version of B4A and the latest SDK configuration file from the link below. Follow the instructions on how to configure B4A.

Are you using an emulator or a real device and which version of Android is on it?

no i have sdk last version.
on android 11 it is ok.
on android 7 got error.
 

Ivica Golubovic

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

Changes:

1.
Added class UltimateJavascriptInterface.
You can add UltimateJavascriptInterface to UltimateWebView via the AddJavascriptInterface method. Example:
Example::
Sub Globals
    Private JSInterface As UltimateJavascriptInterface
End Sub

Sub Activity_Create(FirstTime As Boolean)
    JSInterface.Initialize(Me)
    UltimateWebView1.AddJavascriptInterface(JSInterface,"B4A") '"B4A" is name of javascriptinterface. You can use different name if you want.
End Sub
UltimateJavascriptInterface methods and functions:
  • ShowToast(String message, boolean lengthLong);
  • Log(String logMessage);
  • StartActivity(String activityName);
  • Print();
  • CallSub(String subName, Boolean callUIThread);
  • CallSub(String subName, Boolean callUIThread, String parameter1);
  • CallSub(String subName, Boolean callUIThread, String parameter1, String parameter2);
  • CallSub(String subName, Boolean callUIThread, String parameter1, String parameter2, String parameter3);
  • CallSub(String subName, Boolean callUIThread, String parameter1, String parameter2, String parameter3, String parameter4)
CallSub methods are identical to WebViewExtra2 (great stuff doesn't need to be changed).
Examples of HTML javascript methods to call UltimateJavascriptInterface methods::
B4A.CallSub("[SubName]", true)
'Or
B4A.CallSub("[SubName]", true, "message1")
'Or
B4A.CallSub("[SubName]", true, "message1", "message2")
'Or
B4A.CallSub("[SubName]", true, "message1", "message2", "message3")
'Or
B4A.CallSub("[SubName]", true, "message1", "message2", "message3", "message4")
'Or
var value1 = B4A.CallSub("[SubName]", false,.....)

B4A.ShowToast("[Toast message]", true)

B4A.Log("[Log message]")

B4A.StartActivity("[Activity name]")

B4A.Print()

2. Added custom properties in Designer:
  • AcceptCookies
  • AcceptFileSchemeCookies
  • AcceptThirdPartyCookies
  • AllowContentAccess
  • AllowFileAccess
  • AppCacheEnabled
  • AppCacheMaxSize
  • AllowFileAccessFromFileURLs
  • AllowUniversalAccessFromFileURLs
  • AppCachePath
  • BlockNetworkImage
  • BlockNetworkLoads
  • BuiltInZoomControls
  • CacheMode
  • CursiveFontFamily
  • DatabaseEnabled
  • DatabasePath
  • DefaultFixedFontSize
  • DefaultFontSize
  • DefaultTextEncodingName
  • DisabledActionModeMenuItems
  • DisplayZoomControls
  • DomStorageEnabled
  • EnableSlowWholeDocumentDraw
  • EnableSmoothTransition
  • FantasyFontFamily
  • FixedFontFamily
  • ForceDark
  • GeolocationDatabasePath
  • GeolocationEnabled
  • HorizontalFadingEdgeEnabled
  • HorizontalScrollBarEnabled
  • HorizontalScrollbarThumbColor
  • HorizontalScrollbarTrackColor
  • InitialScale
  • JavaScriptCanOpenWindowsAutomatically
  • JavaScriptEnabled
  • LightTouchEnabled
  • LoadWithOverviewMode
  • LoadsImagesAutomatically
  • MediaPlaybackRequiresUserGesture
  • MinimumFontSize
  • MinimumLogicalFontSize
  • MixedContentMode
  • NeedInitialFocus
  • OffscreenPreRaster
  • RequestFocus
  • SafeBrowsingEnabled
  • SansSerifFontFamily
  • SaveFormData
  • SavePassword
  • ScrollbarFadingEnabled
  • ScrollBarDefaultDelayBeforeFade
  • ScrollBarFadeDuration
  • ScrollBarSize
  • ScrollBarStyle
  • SerifFontFamily
  • SetDownloadListener
  • SetWebChromeClient
  • SetWebViewClient
  • StandardFontFamily
  • SupportMultipleWindows
  • SupportZoom
  • TextZoom
  • UseWideViewPort
  • UserAgentString
  • VerticalFadingEdgeEnabled
  • VerticalScrollBarEnabled
  • VerticalScrollbarPosition
  • VerticalScrollbarThumbColor
  • VerticalScrollbarTrackColor
As of version 2.0, all UltimateWebView settings can be done through the Designer. It does not need to be set programmatically. Of course, the choice is yours.

3. Added methods to UltimateWebView class:
  • RequestFocus As Boolean
  • IsFocused As Boolean
  • ClearFocus

4. Added properties to UltimateWebViewSettings class:
  • HorizontalFadingEdgeEnabled As Boolean
  • HorizontalScrollBarEnabled As Boolean
  • HorizontalScrollBarThumbColor (Color As Int) 'Works from SDK29
  • HorizontalScrollBarTrackColor (Color As Int) 'Works from SDK29
  • ScrollbarFadingEnabled As Boolean
  • ScrollBarDefaultDelayBeforeFade As Int
  • ScrollBarFadeDuration As Int
  • ScrollBarSize As Int
  • VerticalFadingEdgeEnabled As Boolean
  • VerticalScrollBarEnabled As Boolean
  • VerticalScrollBarPosition (Value As Int)
  • VerticalScrollBarThumbColor (Color As Int) 'Works from SDK29
  • VerticalScrollBarTrackColor (Color As Int) 'Works from SDK29

5.
Added events:
  • OnShouldOverrideKeyEvent (KeyCode As Int, AndroidViewKeyEvent As Object) As Boolean
6. Bugs fixed.
 

mzsoft

Member
Version 2.0 released. Download library and documents from first post.

Changes:

1.
Added class UltimateJavascriptInterface.
You can add UltimateJavascriptInterface to UltimateWebView via the AddJavascriptInterface method. Example:
Example::
Sub Globals
    Private JSInterface As UltimateJavascriptInterface
End Sub

Sub Activity_Create(FirstTime As Boolean)
    JSInterface.Initialize(Me)
    UltimateWebView1.AddJavascriptInterface(JSInterface,"B4A") '"B4A" is name of javascriptinterface. You can use different name if you want.
End Sub
UltimateJavascriptInterface methods and functions:
  • ShowToast(String message, boolean lengthLong);
  • Log(String logMessage);
  • StartActivity(String activityName);
  • Print();
  • CallSub(String subName, Boolean callUIThread);
  • CallSub(String subName, Boolean callUIThread, String parameter1);
  • CallSub(String subName, Boolean callUIThread, String parameter1, String parameter2);
  • CallSub(String subName, Boolean callUIThread, String parameter1, String parameter2, String parameter3);
  • CallSub(String subName, Boolean callUIThread, String parameter1, String parameter2, String parameter3, String parameter4)
CallSub methods are identical to WebViewExtra2 (great stuff doesn't need to be changed).
Examples of HTML javascript methods to call UltimateJavascriptInterface methods::
B4A.CallSub("[SubName]", true)
'Or
B4A.CallSub("[SubName]", true, "message1")
'Or
B4A.CallSub("[SubName]", true, "message1", "message2")
'Or
B4A.CallSub("[SubName]", true, "message1", "message2", "message3")
'Or
B4A.CallSub("[SubName]", true, "message1", "message2", "message3", "message4")
'Or
var value1 = B4A.CallSub("[SubName]", false,.....)

B4A.ShowToast("[Toast message]", true)

B4A.Log("[Log message]")

B4A.StartActivity("[Activity name]")

B4A.Print()

2. Added custom properties in Designer:
  • AcceptCookies
  • AcceptFileSchemeCookies
  • AcceptThirdPartyCookies
  • AllowContentAccess
  • AllowFileAccess
  • AppCacheEnabled
  • AppCacheMaxSize
  • AllowFileAccessFromFileURLs
  • AllowUniversalAccessFromFileURLs
  • AppCachePath
  • BlockNetworkImage
  • BlockNetworkLoads
  • BuiltInZoomControls
  • CacheMode
  • CursiveFontFamily
  • DatabaseEnabled
  • DatabasePath
  • DefaultFixedFontSize
  • DefaultFontSize
  • DefaultTextEncodingName
  • DisabledActionModeMenuItems
  • DisplayZoomControls
  • DomStorageEnabled
  • EnableSlowWholeDocumentDraw
  • EnableSmoothTransition
  • FantasyFontFamily
  • FixedFontFamily
  • ForceDark
  • GeolocationDatabasePath
  • GeolocationEnabled
  • HorizontalFadingEdgeEnabled
  • HorizontalScrollBarEnabled
  • HorizontalScrollbarThumbColor
  • HorizontalScrollbarTrackColor
  • InitialScale
  • JavaScriptCanOpenWindowsAutomatically
  • JavaScriptEnabled
  • LightTouchEnabled
  • LoadWithOverviewMode
  • LoadsImagesAutomatically
  • MediaPlaybackRequiresUserGesture
  • MinimumFontSize
  • MinimumLogicalFontSize
  • MixedContentMode
  • NeedInitialFocus
  • OffscreenPreRaster
  • RequestFocus
  • SafeBrowsingEnabled
  • SansSerifFontFamily
  • SaveFormData
  • SavePassword
  • ScrollbarFadingEnabled
  • ScrollBarDefaultDelayBeforeFade
  • ScrollBarFadeDuration
  • ScrollBarSize
  • ScrollBarStyle
  • SerifFontFamily
  • SetDownloadListener
  • SetWebChromeClient
  • SetWebViewClient
  • StandardFontFamily
  • SupportMultipleWindows
  • SupportZoom
  • TextZoom
  • UseWideViewPort
  • UserAgentString
  • VerticalFadingEdgeEnabled
  • VerticalScrollBarEnabled
  • VerticalScrollbarPosition
  • VerticalScrollbarThumbColor
  • VerticalScrollbarTrackColor
As of version 2.0, all UltimateWebView settings can be done through the Designer. It does not need to be set programmatically. Of course, the choice is yours.

3. Added methods to UltimateWebView class:
  • RequestFocus As Boolean
  • IsFocused As Boolean
  • ClearFocus

4. Added properties to UltimateWebViewSettings class:
  • HorizontalFadingEdgeEnabled As Boolean
  • HorizontalScrollBarEnabled As Boolean
  • HorizontalScrollBarThumbColor (Color As Int) 'Works from SDK29
  • HorizontalScrollBarTrackColor (Color As Int) 'Works from SDK29
  • ScrollbarFadingEnabled As Boolean
  • ScrollBarDefaultDelayBeforeFade As Int
  • ScrollBarFadeDuration As Int
  • ScrollBarSize As Int
  • VerticalFadingEdgeEnabled As Boolean
  • VerticalScrollBarEnabled As Boolean
  • VerticalScrollBarPosition (Value As Int)
  • VerticalScrollBarThumbColor (Color As Int) 'Works from SDK29
  • VerticalScrollBarTrackColor (Color As Int) 'Works from SDK29

5. Added events:
  • OnShouldOverrideKeyEvent (KeyCode As Int, AndroidViewKeyEvent As Object) As Boolean
6. Bugs fixed.
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 **
 

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 **
Okay, I'll try on older versions of androids. So far I have tried it on Android 9,10,11. Thank you for pointing me to the problem.
 

Ivica Golubovic

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

Changes:
  • Bugs fixes for older versions of androids (below SDK28).
 
Top