Android Question [SOLVED] Webreader -how to use

kps

Member
Hello everyone.

I saw this thread and tested out the example. Everything works fine.
https://www.b4x.com/android/forum/threads/epubreader-webreader.72560/#content

I particularly like the Webreader which allows you to increase and decrease the font size.

But I am unable to figure out how to use Webreader (without combining it with ePubReader) for opening websites or local html files

The LoadUrl method specifies the parameter as "arg() as string"

I blindly tried
B4A:
WbRd.LoadUrl("http://www.homeopoonga.com/")
I get this error
Webpage not available
The webpage at http://www.homeopoonga.com/ could not be loaded because:

net::ERR_CACHE_MISS

I tried to open a local html file. Webreader shows an empty screen.
B4A:
    File.Copy(File.DirAssets, "trial.html", File.DirInternal, "trial.html")
    WebViewMode = True
    SwitchMode 'Switches to the WebReader mode
    WbRd.LoadUrl(File.Combine(File.DirInternal,"trial.html"))

@Syd Wright
I saw this post of yours.
https://www.b4x.com/android/forum/t...tixs-epubreader-webreader.102663/#post-644170
In the absence of any documentation, how do you people figure out how to use the library ?

Can someone post a simple code snippet ?



Regards,
KPS
 

kps

Member
I don't know whether this is the cause of this error however it is worth a try. Add this line to the manifest editor:

Success !
The website loaded without any problem.
B4A:
WbRd.LoadUrl("http://www.homeopoonga.com/")

More important !
I could change the font size and the text reflowed !
This was like a dream come true for me.

Thanks @Erel.

Well, this magic statement seems to be some kind of panacea !
I had mentioned in this thread, how it solved another problem of mine.
https://www.b4x.com/android/forum/threads/cant-change-webview-to-desktop-mode.120956/#post-756684

Figured out how to load the local HTML also.
B4A:
    File.Copy(File.DirAssets,"index.html",File.DirInternal,"index.html")
    WbRd.LoadUrl("file://" & File.Combine(File.DirInternal,"index.html"))

@Informatix
Thank you for the WebReader Library.

I feel so happy.

Regards,
KPS
 
Last edited:
Upvote 0
Top