Save the html below to a file and upload it to your assets.
Set the webviewstring in the app as indicated below
Call the webviewer with the file:
file:///mnt/sdcard/AppInventor/assets/file.html (for Companion)
file:///mnt/sdcard/android_asset/file.html (for Compiled App)
HTML
<!DOCTYPE html>
<html>
<head>
<meta name=“viewport” content=“width=device-width, initial-scale=1.0”>
<title>Image Set and Read Test</title>
</head>
<body>
<img id="myImage" src="" alt="" />
</body>
<script>
// set webviewstring in AppInventor to "<imagefilename>,altText"
// no commas in the altText !
var img = window.AppInventor.getWebViewString();
document.getElementById("myImage").src = img.split(",")[0];
document.getElementById("myImage").alt = img.split(",")[1];
</script>
</html>