[Free] Create WebViewer by code. DownloadFile. Zoom (or not). Fit to layout. Video. JavaScript


#1

In other post @Shivendra_Kr_Sahu ask to me about create WebViewer by code.
Other user ask to me about DownloadFile with this extension, I have modified and now can download file.

With this extension we can create a WebViewer in a Layout by code.
Features:
fit (true or false): use setLoadWithOverviewMode, ‘zooms out the content to fit on screen by width’
zoom (true or false): allow (or not) zoom.
clickable (true or false) links clickables (or not).
OnPageFinished is an event.
pageHeigh, is a variable.

DownloadFile block is an independent block, you can use it without WebViewer.
url: where is file to download
toDirectory: where download file in sdcard, if that directory isn`t exist, it is created.
Downloading event.
bytesDownloadedToFar: bytes downloaded to far.
bytesToLoad: byte_total in file
percent: percent download now.
completed: boolean (true/false)

  • Notification:
    By Notification you can look, download process.

bajar_archivo_3

  • Mediante esta extensión podemos crear un VisorWeb por código, en su creación podemos establecer que se adapte al ancho de la pantalla mediante la variable booleana fit y permitir o no zoom, mediante la variable, también booleana zoom.
    También he añadido la posibilidad de que puedan funcionar o no los enlaces, mediante la variable clickable.
    También he añadido el bloque de BajarArchivo:
    Puedes bajar un archivo, guardarlo en un directorio de la SdCard, si el directorio no existe, lo crea. Además se puede obterner el número de bytes de bajada.
    Mediante la Notificación, se puede ver el proceso de bajada.
    com.KIO4_CreateWebView.aix (12.2 KB)
    com.KIO4_CreateWebView.aix (13.9 KB)
    com.KIO4_CreateWebView.aix (20.9 KB) (This is last version with DownloadFile).

p194C_extension_CrearVisorWeb.aia (13.8 KB)
p194C_extension_CrearVisorBajarArchivo.aia (21.5 KB) (Example DownloadFile)

If you like this extension and you want to collaborate with the work done, you can donate 7€ or 7$ through this Paypal link:
paypal

http://kio4.com/appinventor/294C_extension_crear_visorweb.htm


How can i make a non clickable webview. Is is possible via extentions
#2

With this extension we can use JavaScript code.

By JavaScript we can build code and link with App Inventor or Thunkable app.

Example: Pythagorean theorem


#3

With this extension we can look video in WebViewer
extension_visorweb6

Upload to our app this file: reproductor.htm

Then in code…


(or file:///android_asset/reproductor.htm)
http://kio4.com/appinventor/294C_extension_crear_visorweb.htm
p194C_extension_CrearVisorWeb.aia (13.8 KB)


#4

excellent extension.
ı need this extension many time.
thanks


#5

very very thank u sir :pray::pray::pray:


#6

what’s the difference with the normal web viewer? (however, congrats)


#7

Is it possible to add a list of URLs in the URL block?


#8

You can see in features:
fit (true or false): use setLoadWithOverviewMode, 'zooms out the content to fit on screen by width’
zoom (true or false): allow (or not) zoom.
OnPageFinished is an event.
pageHeigh, is a variable.
Create by code


#9

ı tried this extension. ı realize that my app is slowing in time. ı use clearclash but its same.


#10

is it possible to have a ‘webviewer. loadHTML’ block, then we don’t have to upload a html to assets


#11

I don’t understand.

You can have a htm file in (example) /mnt/sdcard/mylocalweb/index.htm
Then Create a WebViewer, (Screen1.Initialize) with url = file:///mnt/sdcard/mylocalweb/index.htm


#12

i mean like this:
set variable html as ‘<html ><head > </head ><body >this is body </body ></html >

then
webviewer.loadHTML (html)

appybuilder have the same method


#13

are you using Thunkable FAB? Because that makes a lot of problems and can slow down your app especially when used with map or webviewer.


#14

no ı am not use FAB. now ı use normal web viewer and problem is solved @gre4t_wh1te


#15

@kevinkun

yes, I’ll try that, I think is easy.


#16

I also tested an app compiled from your sample .aia and experienced that the webviewer becomes very unresponsive after some time / after opening several websites. It started to take really long until a touched link would open the linked website… I also experienced pinch to zoom problems – sometimes it works a little, then it stops working…


#17

This extension uses public class WebWiew as ‘original webviewer’,
in the tests that I have made, keep the same speed as the ‘original webviewer’.

To zoom not pinch,.
To zoom, touch with a finger the screen, stop this finger. Now other finger drag over screen. (not pinch).


#18

Hi @kevinkun, here it is.

In this version I have added the blocks: CreateWebViewString and LoadHtmlString.
Now you can set a HTML string and load as web page. (With string, variable pageHeight is 0)

  • En esta nueva versión he añadido los bloques: CreateWebViewString y LoadHtmlString, de tal manera que ahora podemos poner una cadena de caracteres con códigos HTML y visualizarlo como página web. Cuando la página carga como String, la variable de pageHeight es siempre 0.


extension_webview1

com.KIO4_CreateWebView.aix (13.6 KB) (Version 2)
p194C_extension_CrearVisorWebString.aia (15.5 KB)


#19

My motive is to ask this as we do in the earlier extensions. With label, image etc.


#20

For me and @osmanyuksel it becomes very slow and unresponsive after some time therefor something seems to be wrong with it :man_shrugging:t4:

Sorry to say that but no user will zoom like this or understand they would have to…