material/Beiträge/DDI-Vortrag 2/Source/Mobile.vrb

20 lines
515 B
Text

\frametitle {API-Beispiel IIb}
\begin{lsthtml}[caption={webView-Beispiel, UI-Code}]
<html>
<head>
<script>
var droid = new Android();
var speak = function(){
droid.eventPost("say",document.getElementById("say").value);
}
</script>
[...]
</head>
<body>
<form onsubmit="speak(); return false;">
<input type="text" id="say" value="Test." />
<input type="submit" value="Sprich!" />
</form>
</body>
</html>
\end{lsthtml}