mui get phone Device Information

Device device information management module for mobile devices to obtain relevant information, such as IMEI, IMSI, model number, manufacturer and so on. To obtain device information management object through plus.device.

Here is an example name, version, language, network type of equipment I get:

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title></title>

<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />

<link href="../css/mui.css" rel="stylesheet" />

<style type="text/css">

</style>

</head>

 

<body>

<header class="mui-bar mui-bar-nav">

< H1 class = "MUI-title" > My phone information </ h1 >

</header>

<div class="mui-content mui-content-padded">

<div class="mui-text-left">名称:

<span id="memo1"></span>

</div>

<div class="mui-text-left">版本:

<span id="memo2"></span>

</div>

<div class="mui-text-left">语言:

<span id="memo3"></span>

</div>

<div class="mui-text-left">厂商:

<span id="memo4"></span>

</div>

< Div class = "text-MUI-left" > network type:

<span id="memo5"></span>

</div>

</div>

<script src="../js/mui.js"></script>

<script type="text/javascript">

var spans = document.getElementsByTagName('span');

Mui. plus ready ( function () {

// Get the name of the phone

var name = plus.os.name;

// Get a mobile version

was version = plus.os.version;

// Get the language information system

was Language = plus.os.language;

// Get manufacturers

was Vendor = plus.os.vendor

 

var types = {}; // network type

types[plus.networkinfo.CONNECTION_UNKNOW] = "未知";

types [. plus.networkinfo CONNECTION_NONE ] = "not connected to the network" ;

types [. plus.networkinfo CONNECTION_ETHERNET ] = "wired network" ;

types[plus.networkinfo.CONNECTION_WIFI] = "WiFi网络";

types [plus.networkinfo.CONNECTION_CELL2G] = "2G cellular networks" ;

types [plus.networkinfo.CONNECTION_CELL3G] = "3G cellular networks" ;

types [plus.networkinfo.CONNECTION_CELL4G] = "4G cellular networks" ;

var network = types[plus.networkinfo.getCurrentType()];

 

spans[0].innerText = name;

spans[1].innerText = version;

spans[2].innerText = language;

spans[3].innerText = vendor;

spans[4].innerText = network;

});

</script>

</body>

</html>

operation result:

This is the other properties and methods:

Attributes:

IMEI : Equipment International Mobile Equipment Identity

IMSI : International Mobile Subscriber Identity device

Model : device model

Vendor : equipment manufacturers

uuid : uniquely identifies a device

method:

Dial : Call

BEEP : beep

vibrate : Equipment Vibration

setWakelock : whether to stay awake settings (screen lit) state

isWakelock : Gets whether the program has been to stay awake (screen lit) state

the setVolume : system volume setting device

getVolume : acquisition system volume on the device

Guess you like

Origin blog.csdn.net/qq_44567078/article/details/92760426