App-Android(使用App+htnl5框架,解决消息推送兼容SignalR问题)
loulijun2021
2022-09-18 e5d34f5c51e4a852e67d24709ec7e7b708846066
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!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>Orientation Document</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.orientation">orientation</a></h1>
<p>Orientation模块管理设备的方向信息,包括alpha、beta、gamma三个方向信息,通过plus.orientation可获取设备方向管理对象。</p>
<h2>方法:</h2>
<ul>
<li>
<a href="#plus.orientation.getCurrentOrientation">getCurrentOrientation</a>: 获取当前设备的方向信息,包括alpha、beta、gamma三个方向信息</li>
<li>
<a href="#plus.orientation.watchOrientation">watchOrientation</a>: 监听设备方向信息的变化</li>
<li>
<a href="#plus.orientation.clearWatch">clearWatch</a>: 关闭监听设备方向信息</li>
</ul>
<h2>对象:</h2>
<ul>
<li>
<a href="#plus.orientation.OrientationOption">OrientationOption</a>: JSON对象,监听设备方向感应器参数</li>
<li>
<a href="#plus.orientation.Rotation">Rotation</a>: JSON对象,设备方向信息数据</li>
</ul>
<h2>回调方法:</h2>
<ul>
<li>
<a href="#plus.orientation.OrientationSuccessCallback">OrientationSuccessCallback</a>: 获取设备方向信息成功的回调函数</li>
<li>
<a href="#plus.orientation.OrientationErrorCallback">OrientationErrorCallback</a>: 获取设备方向信息失败的回调函数</li>
</ul>
<h2>权限:</h2>
<p>5+功能模块(permissions)</p>
<pre class="prettyprint linenums">
{
// ...
"permissions":{
    // ...
    "Orientation": {
        "description": "方向传感器"
    }
}
}
            </pre>
<h1><a name="plus.orientation.OrientationOption">OrientationOption</a></h1>
<p>JSON对象,监听设备方向感应器参数</p>
<h2>属性:</h2>
<ul><li>frequency: <em>(<font class="type">Number</font>
    类型
)</em>更新方向信息的时间间隔<br><p>数值类型,单位为ms,默认值为500ms。</p>
</li></ul>
<h1><a name="plus.orientation.Rotation">Rotation</a></h1>
<p>JSON对象,设备方向信息数据</p>
<pre class="prettyprint linenums">
interface Rotation {
    readonly attribute float alpha;
    readonly attribute float beta;
    readonly attribute float gamma;
    readonly attribute float magneticHeading;
    readonly attribute float trueHeading;
    readonly attribute float headingAccuracy;
}
                </pre>
<h2>属性:</h2>
<ul>
<li>alpha: <em>(<font class="type">float</font>
    类型
)</em>以z方向为轴心的旋转角度<br><p>浮点数类型,只读属性,取值范围为0到360(不等于360)。</p>
</li>
<li>beta: <em>(<font class="type">float</font>
    类型
)</em>以x方向为轴心的旋转角度<br><p>浮点数类型,只读属性,取值范围为-180到180(不等于180)。</p>
</li>
<li>gamma: <em>(<font class="type">float</font>
    类型
)</em>以y方向为轴心的旋转角度<br><p>浮点数类型,只读属性,取值范围为-180到180(不等于180)。</p>
</li>
<li>magneticHeading: <em>(<font class="type">float</font>
    类型
)</em>设备方向与地球磁场北极方向的角度<br><p>浮点数类型,只读属性,取值范围为0到360(不等于360)。</p>
</li>
<li>trueHeading: <em>(<font class="type">float</font>
    类型
)</em>设备方向与地球真实北极方向的角度<br><p>浮点数类型,只读属性,取值范围为0到360(不等于360)。</p>
</li>
<li>headingAccuracy: <em>(<font class="type">float</font>
    类型
)</em>设备方向值的误差值<br><p>浮点数类型,只读属性,取值范围为0到360(不等于360)。</p>
</li>
</ul>
<h1><a name="plus.orientation.OrientationSuccessCallback">OrientationSuccessCallback</a></h1>
<p>获取设备方向信息成功的回调函数</p>
<pre class="prettyprint linenums">
void onSuccess( rotation ){
    // Get orientation success code.
}
                </pre>
<h2>参数:</h2>
<ul><li>rotation: 
        <em>(
            <font class="type">DOMString</font>
            )
            必选 </em>设备的方向信息Rotation<br>
</li></ul>
<h2>返回值:</h2>
<font class="type">void</font>
            : 无<h1><a name="plus.orientation.OrientationErrorCallback">OrientationErrorCallback</a></h1>
<p>获取设备方向信息失败的回调函数</p>
<pre class="prettyprint linenums">
void onError( error ) {
    // Get orientation error code. 
}
                </pre>
<h2>参数:</h2>
<ul><li>error: 
        <em>(
            <font class="type">DOMException</font>
            )
            必选 </em>失败信息<br>
</li></ul>
<h2>返回值:</h2>
<font class="type">void</font>
            : 无<br><br>
</div></body>
</html>