Skip to content

Commit 34c589d

Browse files
committed
eb 1.4 docs
1 parent fbdd130 commit 34c589d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+5064
-1439
lines changed

eb/en/edge/api/Application.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ Path to file with the model list.
405405
####Type
406406
<span class='text-info'>ARRAY</span>
407407
####Description
408-
Native Menu items.
408+
Native Menu items. To customise the native application menu and controller menu items in ruby follow [Application Menu API](http://docs.rhomobile.com/en/2.2.0/rhodesapi/menu-apis)
409409
####Params
410410
<li><i>Object</i> : <span class='text-info'>HASH</span><p> </p></li><ul><li>label : <span class='text-info'>STRING</span><p>Visible label. </p></li><li>action : <span class='text-info'>STRING</span><p>URL to page which will be loaded. Or it can be a JavaScript method to call: 'javascript: methodOnTab();'. Or path to html page to load. </p></li></ul>
411411
####Access

eb/en/edge/api/Application.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ The ebapi.js file is necessary for all single API inclusions.
110110
<DESC>Visible label.</DESC>
111111
</PARAM>
112112
<PARAM name="action" type="STRING" rhoAction="true">
113-
<DESC>URL to page which will be loaded into tab. It may be path to Ruby controller action; i.e. '/app/Account' would load the Account index action. For ruby callback use 'callback:/app/Account' Or JavaScript method to call: 'javascript: methodOnTab();'. Or path to html page to load.</DESC>
113+
<DESC>URL to page which will be loaded into tab. It may be path to Ruby controller action; i.e. '/app/Account' would load the Account index action. For ruby callback use 'callback:/app/Account' Or JavaScript method to call: 'javascript: methodOnTab();'. Or path to html page to load. </DESC>
114114
<DESC_EB>URL to page which will be loaded. Or it can be a JavaScript method to call: 'javascript: methodOnTab();'. Or path to html page to load.</DESC_EB>
115115
</PARAM>
116116
</PARAMS>
117117
</PARAM>
118-
<DESC>Native Menu items.</DESC>
118+
<DESC>Native Menu items. To customise the native application menu and controller menu items in ruby follow [Application Menu API](http://docs.rhomobile.com/en/2.2.0/rhodesapi/menu-apis)</DESC>
119119
<PLATFORM>WM, CE, Android, Win32, WP8</PLATFORM>
120120
<PLATFORM_EB>WM, CE, Android, Win32</PLATFORM_EB>
121121
</PROPERTY>
@@ -418,4 +418,4 @@ Alert.show_popup(message)
418418
</EXAMPLE>
419419
</EXAMPLES>
420420
</MODULE>
421-
</API>
421+
</API>

eb/en/edge/api/BackButton.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
## Overview
33
The BackButton Module is used to set the parameters of the Back Button. When clicked, the Back button will navigate to the previously loaded page, if any.
44

5-
> Note: When using the backbutton on a VC5090 device, there is the possibility that the display will be slightly distorted while the backbutton is displayed. This only occurs when the backbutton or other similar overlays are on set to be visible.
6-
Other overlays consist of, but are not necessarily limited to:
5+
> Note: When using the backbutton on a VC5090 device, there is the possibility that the display will be slightly distorted while the backbutton is displayed. This only occurs when the backbutton or other similar overlays are set to be visible.
6+
Other overlays include:
77
* addressBar
88
* keystate indicator
99
* forwardbutton
@@ -12,10 +12,11 @@ Other overlays consist of, but are not necessarily limited to:
1212
* quitbutton
1313
* reloadButton
1414
* sipbutton
15+
* settingsbutton
1516
* stopbutton
1617

1718
## Enabling the API
18-
In order to use this API you must include reference to the following JavaScript file that is included with the Enterprise Browser installation:
19+
To use this API you must include a reference to the following JavaScript file that is included with the Enterprise Browser installation:
1920

2021
* elements.js
2122

eb/en/edge/api/EzNFC.md

Lines changed: 307 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,307 @@
1+
#EzNFC
2+
3+
4+
## Overview
5+
This API is used to enable/disable the NFC Adapter and read NFC Tags. **The EzNFC API is currently supported on Android only**.
6+
## Enabling the API
7+
There are two ways to enable Enterprise Browser APIs:
8+
9+
* Include all 'ebapi' modules
10+
* Include only the API modules you need
11+
12+
Both methods are explained below.
13+
14+
Either way, the included files will be from:
15+
`/Enterprise Browser/JavaScript Files/Enterprise Browser`,
16+
a directory on the computer that contains the Enterprise Browser installation.
17+
18+
### Include all JS API modules
19+
To include all JavaScript APIs, copy the `ebapi-modules.js` file to a location accessible by your app's files and include the JavaScript modules file in your app. For instance, to include the modules file in your `index.html`, copy the file to the same directory as your index.html and add the following line to the HEAD section of your index.html file:
20+
21+
:::html
22+
<script type="text/javascript" charset="utf-8" src="ebapi-modules.js"></script>
23+
24+
> This will define the EB class within the page. **Note that the path for this file is relative to the current page** (index.html). Any page on which the modules are required will need to have the required .js file(s) included in this fashion.
25+
26+
### Include only the modules you need
27+
28+
To include individual APIs, you must first include the `ebapi.js` in your HTML, and then the additional required API file(s). For instance, to use the EzNFC API, add the following code to the HTML file(s). Again, this assumes that relevant API files have been copied to the same directory as the HTML.
29+
30+
:::html
31+
<script type="text/javascript" charset="utf-8" src="ebapi.js"></script>
32+
<script type="text/javascript" charset="utf-8" src="eb.eznfc.js"></script>
33+
34+
> In the code lines above, notice that `ebapi.js` is included first, followed by `eb.eznfc.js`, which is the EzNFC API for Enterprise Browser. **This coding is required on each HTML page whenever an individual API will be called from that page**.
35+
36+
37+
38+
39+
##Methods
40+
41+
42+
43+
### disableRead()
44+
Disables NFC read of the application.
45+
46+
####Parameters
47+
<ul><li>callback : <span class='text-info'>CallBackHandler</span></li></ul>
48+
49+
####Returns
50+
Synchronous Return:
51+
52+
* Void
53+
54+
####Platforms
55+
56+
* Android
57+
58+
####Method Access:
59+
60+
* Class Method: This method can only be accessed via the API class object.
61+
* <code>EB.EzNFC.disableRead()</code>
62+
63+
64+
### enableAdapter()
65+
Navigates to device NFC Adapter settings screen if device's NFC Adapter is not enabled.
66+
67+
####Parameters
68+
<ul><li>callback : <span class='text-info'>CallBackHandler</span></li></ul>
69+
70+
####Returns
71+
Synchronous Return:
72+
73+
* Void
74+
75+
####Platforms
76+
77+
* Android
78+
79+
####Method Access:
80+
81+
* Class Method: This method can only be accessed via the API class object.
82+
* <code>EB.EzNFC.enableAdapter()</code>
83+
84+
85+
### enableRead()
86+
Enables NFC read of the application if device supports NFC.
87+
88+
####Parameters
89+
<ul><li>callback : <span class='text-info'>CallBackHandler</span></li></ul>
90+
91+
####Callback
92+
Async Callback Returning Parameters: <span class='text-info'>HASH</span></p><ul><ul><li>Type : <span class='text-info'>STRING</span><p>The Type of NFC Tag that has been read </p></li><li>ID : <span class='text-info'>STRING</span><p>The ID of the Tag that has been read </p></li><li>Payload : <span class='text-info'>STRING</span><p>Payload is the data overall data of NFC Tag </p></li><li>TNF : <span class='text-info'>STRING</span><p>TNF is last 3 bits of Payload </p></li><li>EncodingFormat : <span class='text-info'>STRING</span><p>Text encoding format applied </p></li><li>data : <span class='text-info'>STRING</span><p>The String data that is read from Tag </p></li><li>TagIDHexa : <span class='text-info'>STRING</span><p>NFC Tag id in Hexacode </p></li></ul></ul>
93+
94+
####Returns
95+
Synchronous Return:
96+
97+
* Void
98+
99+
####Platforms
100+
101+
* Android
102+
103+
####Method Access:
104+
105+
* Class Method: This method can only be accessed via the API class object.
106+
* <code>EB.EzNFC.enableRead()</code>
107+
108+
109+
##Properties
110+
111+
112+
113+
###isEnabled
114+
115+
####Type
116+
<span class='text-info'>BOOLEAN</span>
117+
####Description
118+
Detects whether the NFC Adapter is enabled. Returns true if the NFC Adapter is enabled.
119+
####Params
120+
<p><strong>Default:</strong> false</p>
121+
####Access
122+
123+
124+
* Class: This property can only be accessed via the API class object.
125+
* <code>EB.EzNFC.isEnabled</code>
126+
127+
128+
129+
####Platforms
130+
131+
* Android
132+
133+
###isSupported
134+
135+
####Type
136+
<span class='text-info'>BOOLEAN</span>
137+
####Description
138+
Determines whether NFC is supported on the device. Returns true if NFC is supported.
139+
####Params
140+
<p><strong>Default:</strong> false</p>
141+
####Access
142+
143+
144+
* Class: This property can only be accessed via the API class object.
145+
* <code>EB.EzNFC.isSupported</code>
146+
147+
148+
149+
####Platforms
150+
151+
* Android
152+
153+
##Remarks
154+
155+
156+
157+
###General
158+
159+
160+
1. NFC reads are only possible when the application is in the foreground.
161+
2. It is mandatory to disable default NFC application of the device before using this API.
162+
3. The APIs are designed to read NON-Secure NFC Tags.
163+
4. The NFC APIs are designed to work in Reader Mode only.
164+
165+
166+
167+
###Recommended order of API calls
168+
169+
170+
1. EB.EzNFC.isSupported;
171+
2. EB.EzNFC.isEnabled;
172+
3. EB.EzNFC.enableAdapter();
173+
4. EB.EzNFC.enableRead();
174+
5. EB.EzNFC.disableRead();
175+
176+
177+
178+
##Examples
179+
180+
181+
182+
###Usage Guide
183+
This example shows how to use the EzNFC API:
184+
<pre><code>:::javascript
185+
&lt;html&gt;
186+
&lt;head&gt;
187+
&lt;title&gt;Enterprise Browser NFC API Test&lt;/title&gt;
188+
&lt;script type="text/javascript" charset="utf-8" src="ebapi-modules.js"&gt;&lt;/script&gt;
189+
&lt;script type="text/javascript"&gt;
190+
/*
191+
EB.EzNFC.isSupported
192+
Property to check whether NFC is supported on the device.
193+
Return
194+
true - if supported
195+
false - if not supported
196+
*/
197+
function isNfcSupported()
198+
{
199+
var x=EB.EzNFC.isSupported;
200+
document.getElementById("demo1").innerHTML = x;
201+
}
202+
/*
203+
EB.EzNFC.isEnabled
204+
Property to check whether NFC Adapter is enabled on the device.
205+
Return
206+
true - if enabled
207+
false - if not enabled
208+
*/
209+
function isNfcEnabled()
210+
{
211+
var x=EB.EzNFC.isEnabled;
212+
document.getElementById("demo2").innerHTML = x;
213+
}
214+
/*
215+
EB.EzNFC.enableAdapter();
216+
Method to enable the NFC Adapter. Invoking this method brings up the Device settings Activity so user can manually enable the NFC Adapter.
217+
Calling this method has no effect if NFC Adapter is already enabled.
218+
*/
219+
function EnableNfcAdapter()
220+
{
221+
EB.EzNFC.enableAdapter();
222+
}
223+
/*
224+
enableRead(enableNfcCallback1)
225+
Method to enable NFC Tag Reading.
226+
*/
227+
function EnableNfcRead()
228+
{
229+
EB.EzNFC.enableRead(enableNfcCallback1);
230+
}
231+
/*
232+
disableRead();
233+
Method to disable NFC Tag Reading.
234+
*/
235+
function DisableNfcRead()
236+
{
237+
EB.EzNFC.disableRead();
238+
/* Clearing the div of previously read data*/
239+
document.getElementById("demo5").innerHTML = "";
240+
}
241+
/*
242+
enableRead(enableNfcCallback1).
243+
User-defined callback with the enableRead() method.
244+
Gets fired when NFC Tag is Read.
245+
Returns Tag
246+
ID
247+
Type
248+
TNF
249+
Payload
250+
EncodingFormat
251+
Result
252+
*/
253+
function enableNfcCallback1(dat) {
254+
var ID = dat.id;
255+
var Type = dat.type;
256+
var TNF = dat.tnf;
257+
var Payload = dat.payload;
258+
var EncodingFormat = dat.encodingformat;
259+
var Result = dat.result;
260+
var TagIDHexa = dat.tagidhexa;
261+
var ShowData = "ID:" + ID + "&lt;BR&gt;Type:" + Type + "&lt;BR&gt;TNF:" + TNF + "&lt;BR&gt;Payload:" + Payload + "&lt;BR&gt;EncodingFormat:" + EncodingFormat + "&lt;BR&gt;Result:" + Result + "&lt;BR&gt;TagIDHexa: " + TagIDHexa ;
262+
263+
document.getElementById("demo5").innerHTML = ShowData;
264+
}
265+
&lt;/script&gt;
266+
&lt;/head&gt;
267+
&lt;body&gt;
268+
&lt;h2 align="center"&gt;Enterprise Browser NFC API Test&lt;/h2&gt;
269+
&lt;hr&gt;
270+
&lt;br&gt;
271+
&lt;DIV&gt;
272+
&lt;table border=1&gt;
273+
&lt;tr&gt;
274+
&lt;td&gt;
275+
&lt;button onclick="isNfcSupported();"&gt;isSupported&lt;/button&gt;:
276+
&lt;/td&gt;
277+
&lt;td&gt;&lt;div id="demo1"&gt;&lt;/div&gt;&lt;/td&gt;
278+
&lt;/tr&gt;
279+
&lt;tr&gt;
280+
&lt;td&gt;
281+
&lt;button onclick="isNfcEnabled();"&gt;isEnabled&lt;/button&gt;:
282+
&lt;/td&gt;
283+
&lt;td&gt;&lt;div id="demo2"&gt;&lt;/div&gt;&lt;/td&gt;
284+
&lt;/tr&gt;
285+
&lt;tr&gt;
286+
&lt;td colspan=2&gt;
287+
&lt;button onclick="EnableNfcAdapter();"&gt;enableAdapter&lt;/button&gt;:
288+
&lt;/td&gt;
289+
&lt;/tr&gt;
290+
&lt;tr&gt;
291+
&lt;td colspan=2&gt;
292+
&lt;button onclick="EnableNfcRead();"&gt;enableRead&lt;/button&gt;:&lt;/td&gt;
293+
&lt;/td&gt;
294+
&lt;/tr&gt;
295+
&lt;tr&gt;
296+
&lt;td colspan=2&gt;
297+
&lt;button onclick="DisableNfcRead();"&gt;disableRead&lt;/button&gt;:&lt;/td&gt;
298+
&lt;/td&gt;
299+
&lt;/tr&gt;
300+
&lt;/table&gt;
301+
&lt;/DIV&gt;
302+
&lt;DIV id="demo5"&gt;&lt;/DIV&gt;
303+
&lt;/body&gt;
304+
&lt;/html&gt;
305+
306+
307+
</code></pre>

0 commit comments

Comments
 (0)