No announcement yet.

PluriBASIC - New control for Android compilations (WebView)

  • Filter
  • Time
  • Show
Clear All
new posts

  • PluriBASIC - New control for Android compilations (WebView)

    There is a new control called WEBVIEW for Android compilations. In it, you can open websites in the form of a control in the dialogs. It can be used for example like this:

    [FONT="Courier New"][B]
    [COLOR="Blue"]CONTROL[/COLOR] [COLOR="Blue"]ADD[/COLOR] [COLOR="Blue"]WEBVIEW[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Black"]hDlg[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Red"]%ID_FORUMS[/COLOR][COLOR="Black"],[/COLOR] [COLOR="DarkGreen"]""[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Black"]0[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Black"]0[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Black"]360[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Black"]300[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Red"]%WS_JAVASCRIPT[/COLOR][/B][/FONT]
    The %WS_JAVASCRIPT allows the control to execute the javascript code in the invoked URL. Normally popup windows are disabled but the %WS_ALLOWPOPUPS allows the website to open dialogs via javascript code.

    The URL can be changed with CONTROL SET TEXT, If the text is an URL (starts with "http") the control will try to load the welsite, otherwise the text will be set to the control as HTML code directly.

    As a security meassure, CONTROL GET TEXT will not retrieve the HTML code in the control unless it is loaded manually. For URL loaded websites, this statement will only return the URL of the website loaded.

    Other control statements like CONTROL SET COLOR or CONTROL SET STYLE, may not have effect on it.

    This control has the same limitations as any mobile web browser, for example youtube videos need to be started manually via clicking the play button.

  • #2
    I just re-uploaded the installer, correctling a bug in the engine.


    • #3
      A little more work has been put in this control. Now the WebView control sends 5 notifications to the parent dialog:

      Sent when a control is first created and when a URL link is clicked.

      Sent when the page starts loading. This message may be sent several times for a single page if it contains iFrames.

      Sent when a page is finished loading. This message is sent only once, for the main page and not for iFrames. Note that
      this message does not wait until images are loaded in the page, just the source codes.

      This message means the host app had an unrecoverable error, like out of memory or something similar. CB.Wparam will contain the error code number.

      This message means an HTTP error was received. For a list of the HTTP Client errors please click here. The client errors are a value higher than 400, for example: 404 Not found. CB.Wparam will contain the error code number.

      For all this notifications, CB.Text will contain a string representation of the URL causing the event.
      For error notifications, it will also contain the text representation (if available) of the HTTP error description separated with $CRLF. For example:

      "\r\n404 Not found."


      • #4
        Build will properly mute and stop stuff in the WebView when the host dialog is destroyed (DIALOG END) or when the control is individually killed (CONTROL KILL).