/* Licensed under the BSD License. Originally developed by Metropolia Media Works / Mia Santanen Supported by Forum Nokia version: 1.0 */ var serviceObj = null; var bondi = { devicestatus: { getPropertyValue: function (ref) { try { serviceObj = device.getServiceObject("Service.SysInfo", "ISysInfo"); } catch (ex) { alert("Service object cannot be found."); } var criteria = new Object(); if(ref.aspect == "Battery"){ criteria.Entity = "Battery"; if (ref.property == "batteryBeingCharged"){ criteria.Key = "ChargingStatus"; try { var result = serviceObj.ISysInfo.GetInfo(criteria); return result.ReturnValue.Status; } catch (ex) { alert("Error getting charging status: " + ex); } } } } }, geolocation: { getCurrentPosition: function(onPositionSuccess, onPositionError, options) { try { if (!serviceObj) { serviceObj = com.nokia.device.load("", "com.nokia.device.geolocation"); } serviceObj.getCurrentPosition(onPositionSuccess, onPositionError, options); } catch (ex) { alert("Error in geolocation: " + ex.message); } } } }