Network

API Reference: Device.Network

Network is used to retrieve information about the network connections and adapters on the device.

JavaScript
JavaScript
const Page = require("sf-core/ui/page");
const extend = require("js-base/core/extend");
const Network = require('sf-core/device/network');
var Page1 = extend(Page)(
function(_super) {
_super(this, {
onShow: function(params) {
Application.statusBar.visible = false;
this.headerBar.visible = false;
}
});
console.log("Device.Network.IMSI: " + Network.IMSI);
console.log("Device.Network.SMSEnabled: " + Network.SMSEnabled);
console.log("Device.Network.bluetoothMacAddress: "+Network.bluetoothMacAddress);
console.log("Device.Network.carrier: " + Network.carrier);
console.log("Device.Network.connectionType: " + Network.connectionType);
console.log("Device.Network.roamingEnabled: " + Network.roamingEnabled);
console.log("Device.Network.connectionIP: " + Network.connectionIP);
console.log("Device.Network.wirelessMacAddress: " + Network.wirelessMacAddress);
Network.connectionTypeChanged = function(isConnection) {
alert("Connection is " + isConnection);
}
}
);
module.exports = Page1;