<html>
<head>
<meta charset="utf-8"/>
- <meta name="description" content="Systeminfo API Tutorial"/>
- <title>Systeminfo</title>
+ <meta name="description" content="System info API Tutorial"/>
+ <title>System info</title>
<script src="/usr/share/tizen-web-ui-fw/latest/js/jquery.min.js"></script>
<script src="./js/config.js"></script>
<script src="/usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
<script type="text/javascript" src="./js/main.js"></script>
<link rel="stylesheet" type="text/css" href="./css/style.css"/>
</head>
-
<body>
- <div data-role="page" id="main" data-add-back-btn="header">
+
+ <div data-role="page" id="main">
<div data-role="header" data-position="fixed">
<h1>System information</h1>
</div>
-
<div data-role="content">
<ul data-role="listview">
<li id="storage-info">Storage</li>
<li id="orientation-info">Device orientation</li>
</ul>
</div>
-
- <div data-role="footer" data-position="fixed">
- </div>
</div>
- <div data-role="page" id="info" data-add-back-btn="header">
+ <div data-role="page" id="info">
<div data-role="header" data-position="fixed">
<h1 id="info-title"></h1>
</div>
-
<div data-role="content">
<ul data-role="listview" id="info-list">
</ul>
</div>
- <div data-role="footer" data-position="fixed">
- </div>
</div>
+
</body>
</html>
var gInfoTitle = "", gInfo = "", gBatteryListener;
$(document).delegate("#main", "pageinit", function() {
- $("#main .ui-btn-back").bind("vclick", function() {
- tizen.application.getCurrentApplication().exit();
- return false;
- });
$("#storage-info").bind("vclick", function() {
getSystemProperty("STORAGE", onStorageSuccess);
return false;
return false;
});
- document.addEventListener('tizenhwkey', function (e) {
- if (e.keyName === "back") {
+ $(window).on('tizenhwkey', function (e) {
+ if (e.originalEvent.keyName === "back") {
if ($.mobile.activePage.attr('id') === 'main') {
tizen.application.getCurrentApplication().exit();
} else {
}
function onStorageSuccess(storages) {
- gInfoTitle = "STORAGES(" + storages.length + ")";
+ gInfoTitle = "Storages (" + storages.units.length + ")";
gInfo = "";
- for (var i = 0; i < storages.length; i++) {
+ for (var i = 0; i < storages.units.length; i++) {
gInfo += makeDividerListItem("Storage " + (i + 1))
- + make2lineListItem("Type", storages[i].type)
- + make2lineListItem("Capacity", Math.floor(storages[i].capacity / 1000000) + " MB")
- + make2lineListItem("Available capacity", Math.floor(storages[i].availableCapacity / 1000000) + " MB")
- + make2lineListItem("Removable", (storages[i].isRemoveable == true ? "Yes" : "No"));
+ + make2lineListItem("Type", storages.units[i].type)
+ + make2lineListItem("Capacity", Math.floor(storages.units[i].capacity / 1000000) + " MB")
+ + make2lineListItem("Available capacity", Math.floor(storages.units[i].availableCapacity / 1000000) + " MB")
+ + make2lineListItem("Removable", (storages.units[i].isRemoveable == true ? "Yes" : "No"));
}
$.mobile.changePage("#info");
}
function onBatterySuccess(battery) {
- gInfoTitle = "BATTERY";
+ gInfoTitle = "Battery";
gInfo = make2lineListItem("Level", battery.level)
+ make2lineListItem("Charging", (battery.isCharging == true ? "Yes" : "No"));
}
function onDisplaySuccess(display) {
- gInfoTitle = "DISPLAY";
+ gInfoTitle = "Display";
gInfo = makeDividerListItem("Resolution")
+ make2lineListItem("Width", display.resolutionWidth)
+ make2lineListItem("Height", display.resolutionHeight)
}
function onDeviceSuccess(device) {
- gInfoTitle = "DEVICE";
+ gInfoTitle = "Device";
gInfo = make2lineListItem("IMEI", device.imei)
+ make2lineListItem("Model", device.model)
+ make2lineListItem("Version", device.version)
}
function onOrientationSuccess(orientation) {
- gInfoTitle = "DEVICE ORIENTATION";
+ gInfoTitle = "Device orientation";
gInfo = make2lineListItem("Status", orientation.status);
$.mobile.changePage("#info");