B4A Library UltimateWebView Custom View

I tried to test properties such as LoadWithOverviewMode or UseWideViewPort and couldn't see them working anywhere.

Take, for example, the free channel https://www.cbs.com/. These Properties do not affect the display of the site in any way.

What's the matter here? I tried for many other sites - the result is the same.
 

gregchao

Member
Licensed User
Longtime User
Thank you for this library. I needed it to use the "CaptureScreenshotToBitmap" option.

For those of you who are interested in using this library in a B4xPages application, the key is to create an Activity Module rather than a B4xPages module and put the Ultimate code in this module. Also, I needed to check "SetWebViewClient" in Designer.

I have created an example that can be downloaded here.

https://www.dropbox.com/s/o4sgioxtjj0uylv/UltimateWebTest.zip?dl=0
 

gregchao

Member
Licensed User
Longtime User
Why? You can add a "classic" WebView to the Root of a B4XPage and get the Bitmap (B4XBitmap) simply writing Root.Snapshot.
(This doesn't mean this isn't a very useful library)
Thanks. Agreed. Your approach is simpler.
 
Last edited:

Apip Bayok

Member
Hai,
I try to create small project example using B4Xpage, but some or all event like Override and PageFinish not triggered, can you help me, maybe the mistake it's on me..
Thank You
 

peacemaker

Expert
Licensed User
Longtime User
_OverrideUrl
Question is under which Android version: second sub works from API level 24 and above.

I use such:
Private Sub wv_OverrideUrl (Url As String) As Boolean 'Works from API level 1 to API level 23. WebViewClient required.
#If debug
    Log("override=" & Url)
#End If
    Return False
End Sub

Private Sub wv_OverrideUrl2 (WebResourceRequest1 As WebResourceRequest) As Boolean 'Works from API level 24 and above. WebViewClient required.
    Dim URL As String = WebResourceRequest1.GetUrl
    Log("OverrideUrl2 = URL)
    wv_OverrideUrl(URL)
    Return False
End Sub

Any public URL with such JS web-page to check ?
 

mehdipass

Member
Hi,
When I click the back button this error occurs.
Why?

Error:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
    at com.uwebview.ultimatewebview$MyWebViewClient.shouldOverrideKeyEvent(ultimatewebview.java:3963)
    at jm.dispatchKeyEvent(PG:15)
    at com.android.webview.chromium.WebViewChromium.dispatchKeyEvent(PG:7)
    at android.webkit.WebView.dispatchKeyEvent(WebView.java:2952)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1933)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1933)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1933)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1933)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1933)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1933)
    at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:601)
    at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1923)
    at android.app.Activity.dispatchKeyEvent(Activity.java:4107)
    at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:454)
    at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5744)
    at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5612)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5060)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5113)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5079)
    at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5236)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5087)
    at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5293)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5060)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5113)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5079)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5087)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5060)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5113)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5079)
    at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5269)
    at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:5439)
    at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3101)
    at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2644)
    at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2635)
    at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3078)
    at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:143)
    at android.os.MessageQueue.nativePollOnce(Native Method)
    at android.os.MessageQueue.next(MessageQueue.java:363)
    at android.os.Looper.loop(Looper.java:173)
    at android.app.ActivityThread.main(ActivityThread.java:8178)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
 

Ivica Golubovic

Active Member
Licensed User
You must share more information like android version, sdk number, program code. It is hard to solve any problem only from error code.
 

max123

Well-Known Member
Licensed User
Longtime User

Ivica Golubovic

Active Member
Licensed User
Version 2.20 released. Library is now compatible with B4XPages. Download library and documents from first post.

Changes:
  • Added property SwipeToReload (@peacemaker gives me an idea) to UltimateWebView class.
  • Added event OverrideSwipeToReload (UrlToReload As String) As Boolean to UltimateWebView class.
  • Added method SetLayout (Left As Int, Top As Int, Width As Int, Height As Int) to UltimateWebView class.
  • Added method SetLayoutAnimated(Duration As Int,Left As Int,Top As Int,Width As Int,Height As Int) to UltimateWebView class.
  • Added method SetVisibleAnimated(Duration As Int,Visible As Boolean) to UltimateWebView class.
 

max123

Well-Known Member
Licensed User
Longtime User
Thank you for great improvements!
 

Ivica Golubovic

Active Member
Licensed User
Version 2.3 released. Library is now compatible with B4XPages. Download library and documents from first post.

Changes:
  • Added method AllowFullScreenVideo (Allowed As Boolean,ForceLandscape As Boolean) to UltimateWebView class.
  • Library reorganized and deleted unnecessary class imports.
  • Bugs fixed.
AllowFullScreenVideo enables to display videos in full screen (eg youtube videos and other video streaming services). In order for this method to work, it is necessary to prevent Activity redrawing in case of screen orientation changed because all views will lose their instances and restart to initial instances. For these purposes I recommend using the SoftOrientation library. To download the library and read instructions for using the SoftOrientation library, click here.
 

Ivica Golubovic

Active Member
Licensed User
Version 2.31 released. Library is now compatible with B4XPages. Download library and documents from first post.

Changes:
  • Edited event: ShouldInterceptRequest (Url As String) As WebResourceResponse 'Works from API level 11 to API level 20. WebViewClient required.
  • Added event: ShouldInterceptRequest2 (Request As WebResourceRequest) As WebResourceResponse 'Works from API level 21 and above. WebViewClient required.
  • Removed unnecessary imports and unnecessary routines to reduce the size of the library and therefore the size of the final application.
  • Edited WebResourceRequest class (removed Get from properties names).
  • Edited WebResourceResponse class (removed Create3 method and edited Initialize method).
 

Ivica Golubovic

Active Member
Licensed User
IMPORTANT!!!
After one year of its existence, UltimateWebView migrated to WebkitLibrariesSet. The UltimateWebView library will no longer be upgraded in its current form. This thread will be neglected and there will be no answers to the questions asked in this thread. I recommend that you switch your projects in which you use UltimateWebView to WebkitLibrariesSet as soon as possible. To download the set of libraries and more information visit the following thread:

 

max123

Well-Known Member
Licensed User
Longtime User
Oooh.... my application use a lot UltimateWebView. Panic
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…