Good news, I believe I have a solution. Taifuns ListView stuff was very useful, but took me round the houses a bit, until i broke it all down and saw for a very basic working example I hardly needed any of it ;)
Once I had figured out I didn't need to do any uri encoding and decoding, and how to setup the "csv list" to move across as the webviewstring property, it all fell into place.
My examples use images and html file (along with the jquery file) installed as assets on the app for sharing purposes, the eventual aim is to load these separately on the sdcard. I also have some work to do on the css ;)
Here is the code for the webpage (ImageView.html):
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<script src="jquery-1.8.3.min.js"></script>
<title>ImageView</title>
<style>
img {
width:100px;
height:100px;
}
</style>
</head>
<body>
<script>
$(document).ready(function() {
var webString = window.AppInventor.getWebViewString().split(",");
$.each( webString, function( index, val ) {
myextn = ".png";
myval = "\'"+val+"\'";
$("body").append($( '<a href="javascript:;"><img src='+ val + myextn +' onclick="window.AppInventor.setWebViewString('+ myval +')"></a>' ));
});
});
</script>
</body>
</html>
Yes, that is all ;)
Here are the blocks:
A view of the designer window
I'll just explain what is going on:
⦁ In Appinventor I create a list of filenames (without the file extension, which gets added later)
⦁ I then take this list, make into a csv row and create a string, stripping away all the "
⦁ This resultant string is then fed to the WebViewString block
⦁ At this point the WebView is blank
⦁ Clicking on the Home button in the app calls the ImageView,html page
⦁ The javascript picks up the webviewstring and splits it at the commas (,) thereby turning the variable into an array
⦁ This array is then fed into the remainder of the script, with a simple jquery for loop ($.each)
⦁ This takes each item in the array in turn, adds an extension, and creates a return webviewstring value
⦁ The web page is rendered and all the images from the list are displayed, they are <a href> clickable (so they blink) and on clicking an image the name of the image is returned to the app
I'm a cheerful rabbit, a jolly badger, and a dancing ferret all rolled into one :)
See also attached aia for anyone who is interested
ImageView.aia
--
congratulations! keep up the good work!