143 lines
5.0 KiB
HTML
143 lines
5.0 KiB
HTML
<!DOCTYPE HTML>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||
<meta name="HandheldFriendly" content="true">
|
||
<meta name="MobileOptimized" content="320">
|
||
<title>Hello H5+</title>
|
||
<link rel="stylesheet" type="text/css" href="res/doc.css" charset="utf-8">
|
||
<link rel="stylesheet" type="text/css" href="res/prettify.sons.css" charset="utf-8">
|
||
<script type="text/javascript" src="res/doc.js" charset="utf-8"></script><script type="text/javascript" src="res/prettify.js" charset="utf-8"></script>
|
||
</head>
|
||
<body><div id="content" class="content">
|
||
<h1><a name="plus.device">device</a></h1>
|
||
<p>Device模块管理设备信息,用于获取手机设备的相关信息,如IMEI、IMSI、型号、厂商等。通过plus.device获取设备信息管理对象。</p>
|
||
<h2>属性:</h2>
|
||
<ul>
|
||
<li>
|
||
<a href="#plus.device.imei">imei</a>: 设备的国际移动设备身份码</li>
|
||
<li>
|
||
<a href="#plus.device.imsi">imsi</a>: 设备的国际移动用户识别码</li>
|
||
<li>
|
||
<a href="#plus.device.model">model</a>: 设备的型号</li>
|
||
<li>
|
||
<a href="#plus.device.vendor">vendor</a>: 设备的生产厂商</li>
|
||
<li>
|
||
<a href="#plus.device.uuid">uuid</a>: 设备的唯一标识</li>
|
||
</ul>
|
||
<h2>方法:</h2>
|
||
<ul>
|
||
<li>
|
||
<a href="#plus.device.dial">dial</a>: 拨打电话</li>
|
||
<li>
|
||
<a href="#plus.device.beep">beep</a>: 发出蜂鸣声</li>
|
||
<li>
|
||
<a href="#plus.device.vibrate">vibrate</a>: 设备振动</li>
|
||
<li>
|
||
<a href="#plus.device.setWakelock">setWakelock</a>: 设置应用是否保持唤醒(屏幕常亮)状态</li>
|
||
<li>
|
||
<a href="#plus.device.isWakelock">isWakelock</a>: 获取程序是否一直保持唤醒(屏幕常亮)状态</li>
|
||
<li>
|
||
<a href="#plus.device.setVolume">setVolume</a>: 设置设备的系统音量</li>
|
||
<li>
|
||
<a href="#plus.device.getVolume">getVolume</a>: 获取设备的系统音量</li>
|
||
</ul>
|
||
<h2>对象:</h2>
|
||
<ul>
|
||
<li>
|
||
<a href="#plus.screen">screen</a>: Screen模块管理设备屏幕信息</li>
|
||
<li>
|
||
<a href="#plus.display">display</a>: Display模块管理应用可使用的显示区域信息</li>
|
||
<li>
|
||
<a href="#plus.networkinfo">networkinfo</a>: Device模块用于获取网络信息</li>
|
||
<li>
|
||
<a href="#plus.os">os</a>: OS模块管理操作系统信息</li>
|
||
</ul>
|
||
<h2>权限:</h2>
|
||
<p>5+功能模块(permissions)</p>
|
||
<pre class="prettyprint linenums">
|
||
{
|
||
// ...
|
||
"permissions":{
|
||
// ...
|
||
"Device": {
|
||
"description": "设备信息"
|
||
}
|
||
}
|
||
}
|
||
</pre>
|
||
<h1><a name="plus.screen">screen</a></h1>
|
||
<p>Screen模块管理设备屏幕信息</p>
|
||
<h2>属性:</h2>
|
||
<ul>
|
||
<li>
|
||
<a href="#plus.screen.resolutionHeight">resolutionHeight</a>: 设备屏幕高度分辨率</li>
|
||
<li>
|
||
<a href="#plus.screen.resolutionWidth">resolutionWidth</a>: 设备屏幕宽度分辨率</li>
|
||
<li>
|
||
<a href="#plus.screen.scale">scale</a>: 逻辑分辨率与实际分辨率的比例</li>
|
||
<li>
|
||
<a href="#plus.screen.dpiX">dpiX</a>: 设备屏幕水平方向的密度</li>
|
||
<li>
|
||
<a href="#plus.screen.dpiY">dpiY</a>: 设备屏幕垂直方向的密度</li>
|
||
</ul>
|
||
<h2>方法:</h2>
|
||
<ul>
|
||
<li>
|
||
<a href="#plus.screen.setBrightness">setBrightness</a>: 设置屏幕亮度</li>
|
||
<li>
|
||
<a href="#plus.screen.getBrightness">getBrightness</a>: 获取屏幕亮度值</li>
|
||
<li>
|
||
<a href="#plus.screen.lockOrientation">lockOrientation</a>: 锁定屏幕方向</li>
|
||
<li>
|
||
<a href="#plus.screen.unlockOrientation">unlockOrientation</a>: 解除锁定屏幕方向</li>
|
||
</ul>
|
||
<h1><a name="plus.display">display</a></h1>
|
||
<p>Display模块管理应用可使用的显示区域信息</p>
|
||
<h2>属性:</h2>
|
||
<ul>
|
||
<li>
|
||
<a href="#plus.display.resolutionHeight">resolutionHeight</a>: 应用可使用的屏幕高度逻辑分辨率</li>
|
||
<li>
|
||
<a href="#plus.display.resolutionWidth">resolutionWidth</a>: 应用可使用的屏幕宽度逻辑分辨率</li>
|
||
</ul>
|
||
<h1><a name="plus.networkinfo">networkinfo</a></h1>
|
||
<p>Device模块用于获取网络信息</p>
|
||
<h2>常量:</h2>
|
||
<ul>
|
||
<li>
|
||
<a href="#plus.networkinfo.CONNECTION_UNKNOW">CONNECTION_UNKNOW</a>: 网络连接状态未知</li>
|
||
<li>
|
||
<a href="#plus.networkinfo.CONNECTION_NONE">CONNECTION_NONE</a>: 未连接网络</li>
|
||
<li>
|
||
<a href="#plus.networkinfo.CONNECTION_ETHERNET">CONNECTION_ETHERNET</a>: 有线网络</li>
|
||
<li>
|
||
<a href="#plus.networkinfo.CONNECTION_WIFI">CONNECTION_WIFI</a>: 无线WIFI网络</li>
|
||
<li>
|
||
<a href="#plus.networkinfo.CONNECTION_CELL2G">CONNECTION_CELL2G</a>: 蜂窝移动2G网络</li>
|
||
<li>
|
||
<a href="#plus.networkinfo.CONNECTION_CELL3G">CONNECTION_CELL3G</a>: 蜂窝移动3G网络</li>
|
||
<li>
|
||
<a href="#plus.networkinfo.CONNECTION_CELL4G">CONNECTION_CELL4G</a>: 蜂窝移动4G网络</li>
|
||
</ul>
|
||
<h2>方法:</h2>
|
||
<ul><li>
|
||
<a href="#plus.networkinfo.getCurrentType">getCurrentType</a>: 获取设备当前连接的网络类型</li></ul>
|
||
<h1><a name="plus.os">os</a></h1>
|
||
<p>OS模块管理操作系统信息</p>
|
||
<h2>属性:</h2>
|
||
<ul>
|
||
<li>
|
||
<a href="#plus.os.language">language</a>: 系统语言信息</li>
|
||
<li>
|
||
<a href="#plus.os.version">version</a>: 系统版本信息</li>
|
||
<li>
|
||
<a href="#plus.os.name">name</a>: 系统的名称</li>
|
||
<li>
|
||
<a href="#plus.os.vendor">vendor</a>: 系统的供应商信息</li>
|
||
</ul>
|
||
<br><br>
|
||
</div></body>
|
||
</html>
|