notes/Android Poor Mans VNC-6Wwbh18p.html
#on phone:
while [ 1 ];do screencap -p 1.png;mv 1.png 2.png;done
#while running that also startup httpd
busybox httpd -v -p 9999
#client code
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script>
var url = "http://192.168.1.101:9999/2.png";
$(document).ready(function(){
//setInterval(loadimg,500);
loadimg();
});
function loadimg(){
var stamp = new Date().getTime();
var image = new Image();
image.onload = function () {
//console.info("Image loaded:" + cam + "!");
$("body").html(image);
setTimeout(loadimg,1000);
}
image.onerror = function () {
console.error("Cannot load image");
setTimeout(loadimg,1000);
}
image.src = url + "?count=" + stamp;
}
</script>
</head>
<body>
<img id="screen">
</body>
</html>
syntax highlighted by Code2HTML, v. 0.9.1