Search code examples
androidpostwebwebviewapp-inventor

App Inventor WebView AFTER Web Post


I want to connect my App Inventor App to a website, through the web component with a post request. Now, I want to open a webview of the same webpage, with the same POST data that I used with the web component.

My Blocks enter image description here

The webpage is loaded with HTML (like head, body, divs, spans), and what I want is to save that HTML code to a file, and then use the WebView with THAT .html file. For some reason, I always get a blank screen.


Solution

  • You get a blank page, because the file component works asynchronously, which means, the webviewer component is trying to access the file before saving of the file is finished. You therefore should access the webpage in the File.AfterFileSaved event instead.

    Btw. a simpler method (without using the file component) would be to save the file directly using the web component, see also How to download a file and save it on your device