Global

Methods

BarCodeGetActive() → {boolean}

Gets a value indicating whether the scanner is ready.
Source:
See:
  • airlock.scanning.isScannerActive
Returns:
true if the scanner is started and usable; false otherwise.
Type
boolean

BarCodeGetApiVersion() → {string}

Gets the API version of the device SDK. This value is retrieved from the device SDK itself.
Source:
See:
  • airlock.scanning.getApiVersion
Returns:
The API version reported by the device SDK.
Type
string

BarCodeGetDecodersStatus() → {Promise.<object>}

Gets an object (via a promise) containing a property for each decoder, indicating its enabled state. For example, a property is enableAustralianPostal whose value is boolean. True if enabled; false otherwise.
Source:
Returns:
Returns a promise that when resolved has properties representing each decoder's enabled state.
Type
Promise.<object>

BarCodeGetErrorMsg() → {object}

Gets the last scan error. Requires subscription to the scan event via BarCodeSetCallBack;
Source:
See:
Returns:
The last scan error that occured or undefined.
Type
object

BarCodeGetReaderData() → {airlock.scanning.ScanEventArgs}

Gets the result of the last scan event.
Source:
See:
  • airlock.scanning.onScan.addListener
Returns:
The last scan event args.
Type
airlock.scanning.ScanEventArgs

BarCodeGetReaderOutputConfiguration() → {airlock.sdks.cipherLab.CipherLabDeviceConfiguration}

Returns the scanner configuration as an object. Fields can be set, and the configuration can be applied using setConfiguration.
Source:
See:
Returns:
The reader configuration.
Type
airlock.sdks.cipherLab.CipherLabDeviceConfiguration

BarCodeGetReaderServiceVersion() → {string}

Gets the API service version of the device SDK. This value is retrieved from the device SDK itself. There are two version numbers in the current environment for developers. One is "Reader Service Version" and the other is "Reader API version". The two correspond to two different entities. API and its version number are only modified when there are new functions, while reader service and its version number are modified whenever the code of reader service is modified, including both bug fixes and new implementations. So these two version numbers change independently. If there is a new function implemented, both version numbers will change but if the change is simply a bug fix with no API declarations changes then only the version of the reader service will change.
Source:
Returns:
The API service version reported by the device SDK.
Type
string

BarCodeGetReaderType() → {string}

Gets the reader type as reported by the device SDK.
Source:
See:
  • airlock.scanning.getReaderModel
Returns:
The reader type as reported by the device SDK.
Type
string

BarCodeGetScannerVersion() → {string}

Gets the reader firmware version as reported by the device SDK.
Source:
See:
  • airlock.scanning.getFirmwareVersion
Returns:
The reader firmware version as reported by the device SDK.
Type
string

BarCodeGetSymbology(decoderName) → {object}

Retrieves the decoder with the specified name. Device makers use different names for decoders. If you are uncertain of the name, use getDecoderWithNativeId instead.
Parameters:
Name Type Description
decoderName string The name of the decoder. Cannot be null.
Source:
See:
  • airlock.scanning.getDecoderWithName
Returns:
The decoder object that may allow you to modify its state.
Type
object

BarCodeGetUserPreferences() → {airlock.sdks.cipherLab.CipherLabDeviceConfiguration}

Gets the set of preferences. Properties of the configuration object vary depending on the device SDK.
Source:
Returns:
The configuration object.
Type
airlock.sdks.cipherLab.CipherLabDeviceConfiguration

BarCodeInit()

Places the reader into a ready state. You generally do not need to call this function because the scanner is placed into a ready state automatically. Calling this method is equivalent to calling BarCodeSetActive(true).
Source:
See:
  • airlock.scanning.setScannerActive

BarCodeRelease()

Releases the resources of the scanner. This is equivalent to calling BarCodeSetActive(false).
Source:

BarCodeReset() → {Promise}

Resets the scanner configuration. Resets the current devices configuration and removes any settings stored for the barcode reader, including decoder settings and so forth.
Source:
See:
  • airlock.scanning.resetConfiguration
Returns:
When resolved indicates the reset is complete.
Type
Promise

BarCodeSetActive(active)

Starts or stops the scanner.
Parameters:
Name Type Description
active boolean If true the scanner is placed in a started state. If false, the scanner is stopped.
Source:
See:
  • airlock.scanning.setScannerActive

BarCodeSetCallBack(jsFunctionName)

Subscribes to the airlock.scanning.onScan event.
Parameters:
Name Type Description
jsFunctionName string The name of a function. Cannot contain dot point operators. For example, 'foo' is allowed, but 'foo.bar' is not allowed.
Source:
See:
  • airlock.scanning.onScan.addListener

BarCodeSetDecodersStatus(decodersStatus)

Sets the decoder enabled state according to the values set in the specified decodersStatus object.
Parameters:
Name Type Description
decodersStatus object Contains properties for each decoder.
Source:
See:

BarCodeSetReaderOutputConfiguration(configuration)

Applies the specified scanner configuration to the device.
Parameters:
Name Type Description
configuration airlock.sdks.cipherLab.CipherLabDeviceConfiguration The barcode reader configuration.
Source:
See:
  • airlock.scanning.setConfiguration

BarCodeSetSymbology(decoder)

Sets the values of a decoder.
Parameters:
Name Type Description
decoder object The decoder object. Cannot be null.
Source:
See:
  • airlock.scanning.setDecoder

BarCodeSetUserPreferences(userPreference)

Sets the configuration. Properties of the configuration object vary depending on the device SDK.
Parameters:
Name Type Description
userPreference airlock.sdks.cipherLab.CipherLabDeviceConfiguration The configuration object.
Source:

BarCodeSoftScanTrigger()

Simulates pressing hardware trigger for the barcode reader.
Source:
See:
  • airlock.scanning.beginScan

JSBeep(soundMS, silenceMS, toneFrequency, playCount) → {Boolean}

Plays a tone at the specified frequency, followed by silence. This is repeated for the specified repetitions.
Parameters:
Name Type Description
soundMS number The duration of the tone for each repetition. Must be greater than 0.
silenceMS number The duration of silence following the tone for each repetition. Must be greater than or equal to 0.
toneFrequency number The audible frequency of the sound. Must be greater than 0. If 0 is specified then a low frequency tone (698 Hz) is used. If 1 is specified, a medium frequency (1396 Hz) is used. If 2 is specified, a high pitch frequency (2793 Hz) is used. Otherwise the actual specified frequency is used.
playCount number The number of times to play the tone followed by silence. Must be greater than 0.
Source:
Returns:
true if the successful; false otherwise.
Type
Boolean

JSCleanLogFile() → {number}

Deletes the log entries via a Promise.
Source:
See:
  • airlock.log.deleteEntries
Returns:
The number of deleted log entries.
Type
number

JSCloseBrowser(appPackageNameopt) → {boolean}

Exits the app and launches a third-party app specified using its package name. If no package is specified, the app just exits.
Parameters:
Name Type Attributes Description
appPackageName string <optional>
The package to launch upon exit.
Source:
Returns:
True if the package exists; false otherwise.
Type
boolean

JSCopyFile(sourcePath, destinationPath) → {Promise}

Copies the file at the specified sourcePath to the destinationPath. Returns a Promise that when resolved indicates that the file has finished copying. If the Promise is rejected, an error is returned.
Parameters:
Name Type Description
sourcePath string The path to the file that is to be copied.
destinationPath string The location of where to copy the file to.
Source:
See:
  • airlock.io.copyFile
Returns:
Indicating completion or failure of the copy operation. An error is produced by the Promise if an IO Exception is raised.
Type
Promise

JSDeleteFile(path) → {Promise}

Deletes a file at the specified location. Returns a promise indicating success or failure of the operation.
Parameters:
Name Type Description
path string The location of the file to be deleted.
Source:
See:
  • airlock.io.deleteFile
Returns:
If the promise is rejected it indicates the delete was unsuccessful.
Type
Promise

JSFileClose(handle) → {Promise}

Closes the file stream that is presently open for the file. Upon closing a file, its handle becomes invalid.
Parameters:
Name Type Description
handle number A file identifier for the file that was previously returned from openFile.
Source:
See:
  • airlock.io.closeFile
Returns:
A promise that when resolved confirms that the file has been closed.
Type
Promise

JSFileCreate(path) → {Promise.<number>}

Use this function to create a file. It returns a handle (file identifier) to the file, via a Promise. Once the handle is obtained, the file can be written to using the identifier.
Parameters:
Name Type Description
path string The path to the file.
Source:
See:
  • airlock.io.openFile
Returns:
A promise that resolves to a file identifier.
Type
Promise.<number>

JSFileExists(path) → {Promise.<boolean>}

Returns a Promise indicating if the file at the specified location, exists.
Parameters:
Name Type Description
path string The path to the file. Cannot be null.
Source:
See:
  • airlock.io.fileExists
Returns:
True if the file exists; false otherwise.
Type
Promise.<boolean>

JSFileGetCurrentDir() → {string}

Gets Airlock Browser's files directory. This is typically located at /data/data/com.outcoder.ibrowser/files
Source:
See:
  • airlock.io.getAppFilesDirectory
Returns:
The path to the application's files directory.
Type
string

JSFileGetSDDir() → {string}

Gets the path to the shared directory on the device. This may or may not be located on an SD card.
Source:
See:
Returns:
The path to the device's shared storage location for apps.
Type
string

JSFileOpen(path) → {Promise.<number>}

Use this function to open a file. It returns a handle (file identifier) to the file, via a Promise. Once the handle is obtained, the file can be written to or read from using the identifier.
Parameters:
Name Type Description
path string The path to the file.
Source:
See:
  • airlock.io.openFile
Returns:
A promise that resolves to a file identifier.
Type
Promise.<number>

JSFileRead(handle, length) → {Promise.<string>}

Reads the contents of a file as text.
Parameters:
Name Type Description
handle number The file identifier.
length number The length (in bytes) of the file to read.
Source:
See:
  • airlock.io.readText
Returns:
A promise that resolves a string of text read from the file.
Type
Promise.<string>

JSFileReadBase64(handle, length) → {Promise.<string>}

Reads the contents of a file as bytes and returns them as a base64 string.
Parameters:
Name Type Description
handle number The file identifier.
length number The length (in bytes) of the file to read.
Source:
See:
  • airlock.io.readBase64
Returns:
A promise that resolves a base64 string read from the file.
Type
Promise.<string>

JSFileSeek(handle, offset)

Seeks to a location (byte offset) within a file. After which, when a read or write operation is undertaken it will occur at the location specified by the offset parameter.
Parameters:
Name Type Description
handle number The file identifier.
offset number The offset in bytes to move to.
Source:
See:
  • airlock.io.seek

JSFileWriteBase64(handle, base64String) → {Promise}

Writes the specified base64 string to a file with the specified handle (file identifier) at the file's current offset.
Parameters:
Name Type Description
handle number The file identifier.
base64String string The base64 text to write to the file.
Source:
See:
  • airlock.io.writeBase64
Returns:
A promise that when resolved indicates success of the operation.
Type
Promise

JSFileWriteText(handle, text) → {Promise}

Writes the specified text to a file with the specified handle (file identifier) at the file's current offset.
Parameters:
Name Type Description
handle number The file identifier.
text string The text to write to the file.
Source:
See:
  • airlock.io.writeText
Returns:
A promise that when resolved indicates success of the operation.
Type
Promise

JSFullScreenMode(fullScreenopt) → {boolean}

Gets or sets the full screen mode. If the fullScreen parameter is undefined, then a value indicating whether the app is in full screen mode is return. If the fullScreen parameter is supplied, then the screen mode is adjusted accordingly.
Parameters:
Name Type Attributes Description
fullScreen boolean <optional>
Indicates what to set the full screen mode to.
Source:
See:
  • airlock.device.isFullScreen
  • airlock.device.setFullScreen
Returns:
If the fullScreen parameter is not supplied, a value indicating the current full screen mode of the app.
Type
boolean

JSGetAutoRotate() → {airlock.device.OrientationLockType}

Gets the screen orientation setting for the application. Screen orientation can be set globally, for all tabs via the app settings screen; for web applications, via the remote application dialog in the launchpad; or individual pages, using this JavaScript API.
Source:
See:
  • airlock.device.getOrientationLock
Returns:
The orientation enumeration value. 1 is unlocked, 2 is locked portrait, 3 is locked landscape.
Type
airlock.device.OrientationLockType

JSGetBatteryLevel() → {airlock.device.PowerInfo}

Gets an object representing the device's power source and charging state.
Source:
See:
  • airlock.device.getPower
Returns:
With fields representing the device's power source and charge level.
Type
airlock.device.PowerInfo

JSGetBrightness() → {float}

Obtains the screen brightness, which is a float value between 0 and 1.
Source:
See:
  • airlock.device.getBrightness
Returns:
brightness between 0 and 1.
Type
float

JSGetCurrentSsid() → {airlock.device.NetworkInfo}

Gets the information for the current network connection, if any.
Source:
See:
  • airlock.device.NetworkInfo
  • airlock.device.getNetworkInfo
Returns:
The network connection information.
Type
airlock.device.NetworkInfo

JSGetDeviceVolume(streamType) → {number}

Gets a value between 0 and the maximum volume, which can be retrieved using the getMaxVolume function.
Parameters:
Name Type Description
streamType airlock.device.StreamType Indicates the source of the volume.
Source:
See:
  • airlock.device.getMaxVolume
  • airlock.device.getVolume
Returns:
A number between zero and getMaxVolume()
Type
number

JSGetDisplayLanguage() → {string}

Gets the name of the app's UI language. The name is a combination of an ISO 639 two-letter lowercase culture code associated with a language and an ISO 3166 two-letter uppercase subculture code associated with a country or region. For example, en-AU denotes Australian english.
Source:
See:
  • airlock.device.getUILanguage
Returns:
A language code resembling 'en-AU'.
Type
string

JSGetDisplaySleep() → {Boolean}

Gets a value indicating whether the display is currently locked. The function requires device administration privileges be assigned to the app. You can do this via the Enterprise Administration screen within Airlock Browser.
Source:
See:
Throws:
Occurs if Airlock Browser has not been assigned device administration privileges.
Type
Exception
Returns:
true if the screen is locked; false otherwise.
Type
Boolean

JSGetFileOffset(handle) → {number}

Gets the current location (byte offset) within a file. When a read or write operation is undertaken it will occur at the location specified by the offset parameter.
Parameters:
Name Type Description
handle number The file identifier.
Source:
See:
  • airlock.io.getFileOffset
Returns:
The current offset in bytes.
Type
number

JSGetFileSize(handle) → {number}

Gets the size of a file in bytes.
Parameters:
Name Type Description
handle number The file identifier.
Source:
See:
  • airlock.io.getFileSizeBytes
Returns:
The size of the file in bytes.
Type
number

JSGetRingerMode() → {airlock.device.RingerMode}

Gets the ringer mode of the device. Ringer mode determines how the phone behaves when a call is incoming. Ringer mode may be 2 (normal), 0 (silent), or 1 (vibrate).
Source:
See:
  • airlock.device.getRingerMode
Returns:
2 (normal), 0 (silent), or 1 (vibrate)
Type
airlock.device.RingerMode

JSGetSsidList() → {Promise.<Array.<airlock.networking.WirelessNetwork>>}

Gets a promise that returns a list of WirelessNetwork objects.
Source:
See:
  • airlock.networking.getWirelessNetworks
Returns:
A promise that containing a list of wireless networks when fulfilled. The promise may take several seconds to resolve.
Type
Promise.<Array.<airlock.networking.WirelessNetwork>>

JSGetSystemInfo() → {airlock.device.SystemInfo}

Gets a SystemInfo object containing various OS properties.
Source:
See:
  • airlock.device.getSystemInfo
Returns:
Containing various OS properties.
Type
airlock.device.SystemInfo

JSGetTextZoomLevel() → {number}

Gets the text zoom level for the page, which is a positive floating point number, where 1.0 is normal size. 2.0 is double the normal size.
Source:
See:
  • airlock.browsing.getTextZoomLevel
Returns:
The text zoom level, which is greater than 0; where 1.0 is normal size.
Type
number

JSGetWifiPower() → {number}

Gets or sets whether the device is able to connect to wireless networks.
Source:
See:
  • airlock.networking.isWifiEnabled
Returns:
1 if able to connect; 0 otherwise.
Type
number

JSLaunchApp(packageName)

Launches the app specified by its package name. A valid package name might be, for example, 'com.google.android.apps.photos'.
Parameters:
Name Type Description
packageName string The Android package name of the app to open.
Source:
See:
  • airlock.app.launchApp

JSLog(level, message)

Writes a log message at the specified level.
Parameters:
Name Type Description
level airlock.log.LogLevel The log level of the message. All is 1, Debug is 2, Info is 3, Warn is 4, Error is 5
message string The text to write to the log.
Source:

JSMinimizeBrowser()

Sends the user to the Android home screen while minimizing the browser.
Source:
See:
  • airlock.device.minimizeApp

JSReadLogFile() → {Promise.<Array.<airlock.log.LogEntry>>}

Reads the log and returns the entries using a Promise.
Source:
See:
  • airlock.log.getEntries
Returns:
Resolves a list of log entries.
Type
Promise.<Array.<airlock.log.LogEntry>>

JSRenameFile(sourcePath, destinationPath) → {Promise}

Moves the file at the specified sourcePath to the destinationPath. Returns a Promise that when resolved indicates that the file has finished being moved. If the Promise is rejected, an error is returned.
Parameters:
Name Type Description
sourcePath string The path to the file that is to be move from.
destinationPath string The location of where to move the file to.
Source:
See:
Returns:
Indicating completion or failure of the move operation. An error is produced by the Promise if an IO Exception is thrown.
Type
Promise

JSSetAutoRotate(mode)

Sets the orientation for the browser tab, when it is active. The value set via this function overrides any orientation lock values from the settings within the app.
Parameters:
Name Type Description
mode number 1 is unlocked, 2 is locked portrait, 3 is locked landscape.
Source:
See:
  • airlock.device.setOrientationLock

JSSetBrightness(brightness)

Sets the screen brightness to a value between 0 and 1. The specified value is clamped between 0.1 and 1 to prevent the device being unusable.
Parameters:
Name Type Description
brightness number A value between 0 and 1.
Source:
See:
  • airlock.device.setBrightness

JSSetDeviceVolume(streamType, volume)

Sets a value between 0 and the maximum volume, which can be retrieved using the getMaxVolume function.
Parameters:
Name Type Description
streamType airlock.device.StreamType Indicates the source of the volume.
volume number A value between 0 and the maximum volume, which can be retrieved using the getMaxVolume function.
Source:
See:
  • airlock.device.setVolume

JSSetDisplaySleep(enable)

Engages or disengages the devices screen lock. The function requires device administration privileges be assigned to the app. You can do this via the Enterprise Administration screen within Airlock Browser.
Parameters:
Name Type Description
enable boolean If true the display is locked. If false, its unlocked.
Source:
See:
Throws:
Occurs if Airlock Browser has not been assigned device administration privileges.
Type
Exception

JSSetHttpErrorAction(actionopt, urlopt)

Sets the navigation error action associate with the specified URL. If a URL is not specified, the navigation error action for the current remote web application is returned. And, if that is not specified, the browser's navigation error action setting is returned.
Parameters:
Name Type Attributes Description
action airlock.networking.NavigationErrorAction <optional>
The action to perform when a navigation error occurs.
url string <optional>
The URL of the page for which to determine the navigation error action. Can be undefined.
Source:
See:
  • airlock.browsing.setNavigationErrorAction

JSSetRingerMode(mode)

Sets the ringer mode of the device. Ringer mode determines how the phone behaves when a call is incoming. Ringer mode may be 2 (normal), 0 (silent), or 1 (vibrate).
Parameters:
Name Type Description
mode airlock.device.RingerMode Allowed values are 2 (normal), 0 (silent), or 1 (vibrate)
Source:
See:
  • airlock.device.setRingerMode

JSSetTextZoomLevel(level)

Sets the text zoom level for the page, which is a positive floating point number, where 1.0 is normal size. 2.0 is double the normal size. The specified value is clamped between 0.1 and 5.0.
Parameters:
Name Type Description
level number The text zoom level, which is greater than 0; where 1.0 is normal size.
Source:
See:
  • airlock.browsing.setTextZoomLevel

JSSetWifiPower(mode)

Enables or disables wireless networking.
Parameters:
Name Type Description
mode number If 1, WIFI is enabled; otherwise, it is disabled.
Source:
See:
  • airlock.networking.setWifiEnabled

JSVibrate(onTimeopt, offTimeopt, countopt) → {Boolean}

Causes the device to vibrate for the specified duration.
Parameters:
Name Type Attributes Description
onTime number <optional>
The duration for which to vibrate, in milliseconds. If not specified, a value of 100 MS is used.
offTime number <optional>
The pause time in milliseconds between repetitions. Default is 0.
count number <optional>
The number of times to vibrate then pause.
Source:
See:
  • airlock.device.vibrate
Returns:
true if the successful; false otherwise.
Type
Boolean