Device Information JavaScript Functions

You can find the JavaScript test page at https://www.android-kiosk.com/jstest.htm Just set this as the Kiosk URL on your device to test the functions.

Get WiFi SSID
Returns WIFI SSID, requires version 1.42 or higher.

<script>
//GET WIFI SSID
function getWIFISSID() {
return Android.getWIFISSID();
}
</script>
<a href="javascript:console.log(getWIFISSID());">Get WiFi SSID</a>


Get IP Address
Returns IP address of WiFi adapter, requires version 2.0.6 or higher.

<script>
//GET IP ADDRESS
function getIPAddress() {
return Android.getIPAddress();
}
</script>
<a href="javascript:console.log(getIPAddress());">Get IP Address</a>


Get Device Battery Level
Returns device battery percentage, requires version 1.42 or higher.

<script>
//RETRIEVES CURRENT BATTERY LEVEL & DISPLAYS IN TOAST
function getDeviceBatteryLevel() {
return Android.getBatteryLevel();
}
</script>
<a href="javascript:console.log(getDeviceBatteryLevel());">Get Device Battery Level</a>


Get Charging State
Returns charging state (true or false), requires version 2.0.34 or higher.

<script>
//GET CHARGING STATE
function isCharging() {
return Android.isCharging();
}
</script>
<a href="javascript:console.log(isCharging());">Get Charging State</a><br/>


Get MAC Address
Returns device MAC address (normally WiFi), requires version 1.42 or higher.
Please note that the MAC address and IMEI can no longer be read from Android 7.0 and up.

<script>
//GET MAC ADDRESS
function getMacAddress() {
return Android.getMacAddress();
}
</script>
<a href="javascript:console.log(getMacAddress());">Get MAC Address</a>


Get IMEI
Returns device IMEI, requires version 1.42 or higher.
Please note that the MAC address and IMEI can no longer be read from Android 7.0 and up.

<script>
//GET IMEI
function getIMEI() {
return Android.getIMEI();
}
</script>
<a href="javascript:console.log(getIMEI());">Get IMEI</a>


Get SIM Serial Number
Returns SIM serial number, requires version 2.5.4 or higher.
Please note that the MAC address and IMEI can no longer be read from Android 7.0 and up.

<script>
//GET SIM SERIAL NUMBER
function getSimSerialNumber() {
return Android.getSimSerialNumber();
}
</script>
<a href="javascript:console.log(getSimSerialNumber());">Get SIM Serial Number</a>


Get Mobile Operator
Returns mobile operator name, requires version 2.5.4 or higher.
Please note that the MAC address and IMEI can no longer be read from Android 7.0 and up.

<script>
//GET MOBILE OPERATOR
function getMobileOperator() {
return Android.getMobileOperator();
}
</script>
<a href="javascript:console.log(getMobileOperator());">Get Mobile Operator</a>


Get Serial Number
Returns device serial number (Build.SERIAL), for Samsung devices use getAlternativeSerialNumber() instead, requires version 1.43 or higher.

<script>
//GET SERIAL NUMBER
function getSerialNumber() {
return Android.getSerialNumber();
}
</script>
<a href="javascript:console.log(getSerialNumber());">Get Serial Number</a>


Get Alternative Serial Number
Returns alternative device serial number. Some device manufacturers such as Samsung do not store the serial in the default Android Build.SERIAL location. Requires version 2.0.40 or higher.

<script>
//GET ALTERNATIVE SERIAL NUMBER
function getAlternativeSerialNumber(type) {
//DEFAULT BUILD.SERIAL = 0
//RIL.SERIAL = 1;
//RO.SERIAL = 2;
//SYS.SERIAL = 3;
return Android.getAlternativeSerialNumber(type);
}
</script>
<a href="javascript:console.log(getAlternativeSerialNumber(1));">Get Serial Number (RIL.SERIAL_NUMBER = 1)</a>


Get Brand
Returns device brand, requires version 1.51 or higher.

<script>
//GET BRAND
function getBrand() {
return Android.getBrand();
}
</script>
<a href="javascript:console.log(getBrand());">Get Brand</a>


Get Model
Returns device model, requires version 1.51 or higher.

<script>
//GET MODEL
function getModel() {
return Android.getModel();
}
</script>
<a href="javascript:console.log(getModel());">Get Model</a>


Get Unique Device Identifier
Returns unique device identifier (remote management), requires version 2.0.23 or higher.

<script>
//GET UNIQUE IDENTIFIER
function getUniqueIdentifier() {
return Android.getUniqueIdentifier();
}
</script>
<a href="javascript:console.log(getUniqueIdentifier());">Get Unique Device Identifier</a>


Get Android ID
Returns Android ID, requires version 2.0.38 or higher.

<script>
//GET ANDROID ID
function getAndroidID() {
return Android.getAndroidID();
}
</script>
<a href="javascript:console.log(getAndroidID());">Get Android ID</a>


Get Kiosk Browser Build
Returns Kiosk Browser Build number, requires version 2.6.3 or higher.

<script>
//GET ANDROID ID
function getKioskBuild() {
return Android.getKioskBuild();
}
</script>
<a href="javascript:console.log(getKioskBuild());">Get Kiosk Build</a>


Get Kiosk Browser Version
Returns Kiosk Browser version, requires version 2.6.3 or higher.

<script>
//GET ANDROID ID
function getKioskVersion() {
return Android.getKioskVersion();
}
</script>
<a href="javascript:console.log(getKioskVersion());">Get Kiosk Version</a>
Was this article helpful?
Thank you!