Implement local Html in WebView with App Inventor.
when I try to use "input" for pick a image in cellphone, doesn't react...
<html >
<head>
<meta charset="UTF-8">
<input type="file" id="fileElem" multiple accept="image/*" style="display:none" onchange="handleFiles(this.files)">
<a href="#" id="fileSelect">Pick some files</a>
<script type="text/javascript">
window.URL = window.URL || window.webkitURL;
var fileSelect = document.getElementById("fileSelect"),
fileElem = document.getElementById("fileElem"),
fileList = document.getElementById("fileList");
fileSelect.addEventListener("click", function (e) {
if (fileElem) {
fileElem.click();
}
e.preventDefault(); // prevent navigation to "#"
}, false);
</script>
I use WebView in app inventor. The Html is a local file. I only can use style sheets and libraries in the same directory as the main html file.
It is not possible to use the webviewer
component to pick files in App Inventor.
The webviewer
is no full browser and you can't pick files like this. You will have to use the activity starter
for that, see for example How to pick a file from SD card.
Btw. generally you can use style sheets and libraries together with the webviewer
...
If you use html files including js and css files, which use a directory structure, you have 2 options: