B4A Library Little WebView Extension v1.20

NeoTechni

Well-Known Member
Licensed User
Longtime User
I've having trouble getting it to scroll to the bottom of the page right after the page loads. It scrolls once, then goes right back to the top and refuses to go back down
 

Roeschti

Member
Licensed User
Longtime User
Well, the base of the lib is the official stuff from here:
WebView | Android Developers

I dont have ICS on my devices, so maybe there are differences in the behaviour / implementation in diffrent API levels.

Check the link above and feel free to change the lib in the way you like it
 

francoisg

Active Member
Licensed User
Longtime User
WebView Events

Hi,
will it be possible for you to add WebView events handling? I need to know when the zoom scale changes for instance (onScaleChanged) / the page is being scrolled (onScrollchanged)!

Then the hard one - would it be possible to catch the onDraw event?
 

jroriz

Active Member
Licensed User
Longtime User
Same for me.

To get the thing done, I used:

B4X:
Dim InTopEdge As Int
InTopEdge = wvXtender.getScrollY(WebView1)
   
'wvXtender.scrollBY(WebView1, 0, 1) -- does not work...
wvXtender.scrollTO(WebView1, 0, InTopEdge + 1)
 

Shaun

Member
Licensed User
Longtime User
I just want to thank you for your work on this! This is perfect for a project I am doing for my boss. I'm making an android version of our web based, 'in out board', which lets folks know where we are and what we are doing at work. This library makes my little app very rich.

Another programmer at work has been attempting to make this simple Droid (his first stab at Android programming) app in Java for over a month. Took me a few hours with B4a and this library, and mine is a lot cleaner and nicer features! Lovin' it!
 

Derek Johnson

Active Member
Licensed User
Longtime User
I've used this hack to get handle the 404 Not Found Error. It relies on the returned document title being '404 Page Not Found'

B4X:
Sub WebView1_PageFinished (Url As String)
WebEx.executeJavascript(WebView1, "B4A.CallSub('JavascriptCallback', true, document.title)")
End Sub

Sub JavascriptCallback(string1 As String)
       If string1.StartsWith("404") Then
           log("Page not found! ")
       End If
    Activity.Title=string1
End Sub
 

fash866

Member
Licensed User
Longtime User
I am try.
 

Roeschti

Member
Licensed User
Longtime User
Wow, such a long time ago and my lib is still in use! Have fun and keep rockin'
 

Leni Berry

Active Member
Licensed User
Longtime User
how to get page source like in chrome menu "view page source"? is it possible with this library?
 

danijel

Active Member
Licensed User
Longtime User
Hi @Roeschti. Still rockin in 2016
But this is not working for me.
I always get default icon :/

B4X:
Sub Webview1_PageFinished (Url As String)

    Dim FavIco, DefaultIcon As Bitmap
    DefaultIcon.Initialize(File.DirAssets, "home.png")
    FavIco.Initialize3(wvXtender.getFaviconFromUrl(Url, DefaultIcon))
    FavIcon.Bitmap=FavIco
   
End Sub


Can you please provide me working code?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…