Файл: html/android.html
Строк: 57
<?php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Hello</title>
<style>
body, html {
height: 100%;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
color: #F89821;
background-color: #ffffff;
padding: 20px;
margin-bottom: 100px;
}
</style>
</head>
<body>
<input type="button" value="Say hello" onClick="showAndroidToast('Hello Android!')" />
<br/><br/>
<input type="button" value="Show Version" onClick="showVersion('called within the html')" />
<br/><br/>
<p id="version"></p>
<script type="text/javascript">
<!-- Sending value to Android -->
function showAndroidToast(toast) {
AndroidInterface.showToast(toast);
}
<!-- Getting value from Android -->
function showVersion(msg) {
var myVar = AndroidInterface.getAndroidVersion();
document.getElementById("version").innerHTML = msg + " You are running API Version " + myVar;
}
</script>
</body>
</html>
?>