One of the used frameworks integrated with DecSoft App Builder is Apache Cordova. This framework is well integrated in DecSoft App Builder in various ways for your convenience. Continue reading this help topic to see how Apache Cordova is integrated in DecSoft App Builder.
DecSoft App Builder creates the right Apache Cordova configuration file for your app, based in Apache Cordova related options that you can set. One of these options are the Extra XML one, which allows to add optional stuff to the Apache Cordova configuration file.
When you check the "Create a Cordova config file" from the Apache Cordova General app options, the next time that the app is compiled, DecSoft App Builder creates several icons (based in the app icon that you can set in the app Interface options) for all the supported platforms. These icons are well referred then in the Apache Cordova configuration file, in order to be used by the platforms in which our app was running.
You can additionally set "adaptative icons" for the Android platform. DecSoft App Builder take these icons (if provided) also to generate the appropriate adaptative icons.
When you check the "Create a Cordova config file" from the Apache Cordova General app options, the next time that the app is compiled, DecSoft App Builder creates several splash screens (based in the app splash screen that you can set in the app Apache Cordova Splashs options) for all the supported platforms. These splash screens are well referred then in the Apache Cordova configuration file, in order to be used by the platforms in which our app was running.
When you check the "Create a Cordova config file" from the Apache Cordova General app options, and then check one or more of the Batch & Shell platforms, the next time that the app is compiled, DecSoft App Builder creates the right batch files for Microsoft Windows.
DecSoft App Builder creates various batch files per platform. Take a look at the below tables, which refers the batch files to be executed in Microsoft Windows:
Batch file | Description |
---|---|
cordova_android_debug.bat | Execute this file to get a debug APK of the app. This debug release can be then copied to a device in order to debug it. |
cordova_android_run.bat | Connect an Android device to your computer and then execute this file in order to get a debug release APK of the app launched in your device to be debugged. This is probably the best way to try the apps in the Android platform. If no connected devices are found, the configured emulator is used instead. |
cordova_android_release.bat | Execute this file to get a release APK of the app. This release can be then copied to a device or deployed in the Play Store or any other Android store. |
cordova_android_simulate.bat | Execute this file to get a debug the app in the Apache Cordova simulator software. |
Batch file | Description |
---|---|
cordova_electron_debug.bat | Execute this file to get a debug EXE file of the app in order to be debugged. |
cordova_electron_release.bat | Execute this file to get a release EXE file of the app in order to be deployed. |
cordova_electron_run.bat | Execute this file to get a preview (no build) of the app in order to be debugged. |
Batch file | Description |
---|---|
cordova_ios.bat | Execute this file to get an XCode project files to be opened and compiled using an Apple Mac OS computer. Unfortunately it's not possible to create IPA files of the app from Microsoft Windows, so this file creates the right XCode project files only. |
When you check the "Create a Cordova config file" from the Apache Cordova General app options, and then check one or more of the Batch & Shell platforms, the next time that the app is compiled, DecSoft App Builder creates the right shell files for Apple Mac OS.
DecSoft App Builder creates various shell files per platform. Take a look at the below tables, which refers the shell files to be executed in Apple Mac OS:
Shell file | Description |
---|---|
cordova_ios_debug.sh | Execute this shell file from your Apple Mac OS computer to get an XCode project files ready to be opened, compiled and debugged in some device or emulator. |
cordova_ios_release.sh | Execute this shell file from your Apple Mac OS computer to get an XCode project files ready to be opened, compiled and archived, to get the app IPA files to be deployed in the Apple Store or in another possible way. |
Shell file | Description |
---|---|
cordova_electron_debug.sh | Execute this shell file from your Apple Mac OS computer to get a debug compilation of the app for the Apple Mac OS platform using Cordova Electron. |
cordova_electron_release.sh | Execute this shell file from your Apple Mac OS computer to get a release compilation of the app for the Apple Mac OS platform using Cordova Electron. |
cordova_electron_run.sh | Execute this shell file from your Apple Mac OS computer to get a debug compilation of the app and then launch it using Cordova Electron. |
DecSoft App Builder generates for you several Apache Cordova related JSON files. For example, when you want to sign your Android apps, sign your Apple iOS apps and sign your Microsoft Windows (Electron) apps, the right JSON files with the signing information are generated by DecSoft App Builder, so can be used when compile the app using Apache Cordova.
There are hundreds of useful Apache Cordova plugins ready to be used in your app when needed. Every Apache Cordova plugin exposes a JavaScript API in form of JavaScript objects and methods ready to be called. We can use these plugins to get information about the user device, to capture audio and video and many more things.
DecSoft App Builder integrates "out of the box" all the official Apache Cordova plugins. You can use these plugins just by checking them in the app options. Doing that the selected plugins are included in the generated Batch files and Shell files, in order to be installed for your app.
By checking one of the available Apache Cordova plugins from the app options, the IDE code editor offers to you the available plugin variables and methods, ready to be used, as you can see in the below animated GIF image:
Below you can see refer all the "out of the box" Apache Cordova plugins integrated in DecSoft App Builder, as well the JavaScript API that these plugins provides to you.
The Apache Cordova File plugin offers to you the ability to access the user device files and manipulate it. DecSoft App Builder, based in this plugin, put available the below JavaScript variables and methods.
This is the File object provided by Apache Cordova, and, among other stuff, stores the root directories in which we can place directories and files from our apps. You must use one of this root directories along other methods in this plugin.
Name | Type | Description |
---|---|---|
applicationDirectory | String | Read-only directory where the application is installed. (iOS, Android, BlackBerry 10, OSX, windows). |
applicationStorageDirectory | String | Root directory of the application's sandbox; on iOS & windows this location is read-only (but specific subdirectories [like /Documents on iOS or /localState on windows] are read-write). All data contained within is private to the app. (iOS, Android, BlackBerry 10, OSX). |
dataDirectory | String | Persistent and private data storage within the application's sandbox using internal memory (on Android, if you need to use external memory, use .externalDataDirectory). On iOS, this directory is not synced with iCloud (use .syncedDataDirectory). (iOS, Android, BlackBerry 10, Windows). |
cacheDirectory | String | Directory for cached data files or any files that your app can re-create easily. The OS may delete these files when the device runs low on storage, nevertheless, apps should not rely on the OS to delete files in here. (iOS, Android, BlackBerry 10, OSX, Windows). |
externalApplicationStorageDirectory | String | Application space on external storage. (Android). |
externalDataDirectory | String | Where to put app-specific data files on external storage. (Android). |
externalCacheDirectory | String | Application cache on external storage. (Android). |
externalRootDirectory | String | External storage (SD card) root. (Android, BlackBerry 10). |
tempDirectory | String | Temp directory that the OS can clear at will. Do not rely on the OS to clear this directory; your app should always remove files as applicable. (iOS, OSX, Windows). |
syncedDataDirectory | String | Holds app-specific files that should be synced (e.g. to iCloud). (iOS, Windows). |
documentsDirectory | String | Files private to the app, but that are meaningful to other application (e.g. Office files). Note that for OSX this is the user's ~/Documents directory. (iOS, OSX). |
sharedDirectory | String | Files globally available to all applications (BlackBerry 10). |
You can use this plugin method create a new directory. This method admits the below arguments:
Name | Type | Description |
---|---|---|
rootDir | String | The root directory in which you want to create a directory. The root directory can be one of the available "cordova.file.*" values. |
dirName | String | The name of the directory that you want to create. |
successCallback | Function | You can set here a JavaScript function to be called when the directory has been successfully created. |
errorCallback | Function | You can set here an optional JavaScript function to be called if some error occur while create the directory. This function receives an "error" variable with an error object. |
You can use this plugin method to check if a directory exists or not. This method admits the below arguments:
Name | Type | Description |
---|---|---|
dirPath | String | The directory path that you want to check. |
successCallback | Function | You must use a success callback function here. This function receive a boolean argument which is "true" if the directory exists and "false" when not. |
errorCallback | Function | You can set here an optional JavaScript function to be called if some error occur while check the directory. This function receives an "error" variable with an error object. |
You can use this plugin method to remove the specified directory recursively. This method admits the below arguments:
Name | Type | Description |
---|---|---|
dirPath | String | The directory path that you want to remove. |
successCallback | Function | You can place a callback function which is executed if the directory has been successfully removed. |
errorCallback | Function | You can set here an optional JavaScript function to be called if some error occur while remove the directory. This function receives an "error" variable with an error object. |
You can use this plugin method create a new file. Sometimes you need to create a file, for example, if you plain to use the Media plugin. This method admits the below arguments:
Name | Type | Description |
---|---|---|
dirPath | String | The directory path in which you want to create the file. |
fileName | String | The file name that you want to create, for example, "My new file.txt". |
successCallback | Function | You can set here a JavaScript function to be called when the file has been successfully created. This function callback receives the created file URL, ready to be used, for example, with the Media plugin. |
errorCallback | Function | You can set here an optional JavaScript function to be called if some error occur while create the file. This function receives an "error" variable with an error object. |
You can use this plugin method to check if the specified file exists.
Name | Type | Description |
---|---|---|
filePath | String | The file path that you want to check. |
successCallback | Function | You must use a success callback function here. This function receive a boolean argument which is "true" if the file exists and "false" when not. |
errorCallback | Function | You can set here an optional JavaScript function to be called if some error occur while check the file. This function receives an "error" variable with an error object. |
You can use this plugin method to remove the specified file. This method admits the below arguments:
Name | Type | Description |
---|---|---|
dirPath | String | The directory path in which the file resides. |
fileName | String | The file name to be removed. |
successCallback | Function | You can place a callback function which is executed if the file has been successfully removed. |
errorCallback | Function | You can set here an optional JavaScript function to be called if some error occur while remove the file. This function receives an "error" variable with an error object. |
You can use this plugin method to write an arbitrary file type in the user's device. This method can be useful, for example, to write / save a downloaded file using the Http control. This method admits the below arguments:
Name | Type | Description |
---|---|---|
dirPath | String | The directory path in which the file must be writed. |
fileName | String | The file name that you want to write, for example, "myFile.png". |
fileType | String | The MIME file type that you want to use, for example, "image/png". |
contents | String | The content that you want to write into the file. |
successCallback | Function | You can set here an optional JavaScript function to be called when the file has been successfully written. |
errorCallback | Function | You can set here an optional JavaScript function to be called if some error occur while write the file. This function receives an "error" variable with an error object. |
You can use this plugin method to easily write a text file in the user device. This method admits the below arguments:
Name | Type | Description |
---|---|---|
dirPath | String | The directory path in which the file must be placed. |
fileName | String | The file name that you want to write, for example, "myFile.txt" or "myFile.json". |
contents | String | The text content that you want to write into the file. Can be just plain text but also a serialized JSON object, for example. |
successCallback | Function | You can set here an optional JavaScript function to be called when the file has been successfully written. |
errorCallback | Function | You can set here an optional JavaScript function to be called if some error occur while write the file. This function receives an "error" variable with an error object. |
You can use this plugin method to easily append text into a text file in the user device. This method admits the below arguments:
Name | Type | Description |
---|---|---|
dirPath | String | The directory path in which the text file is placed or in which must be created if not exists. |
fileName | String | The file name that you want to append text, for example, "myFile.txt" or "myFile.json". |
contents | String | The text content that you want to append into the file. Can just plain text but also a serialized JSON object. |
successCallback | Function | You can set here an optional JavaScript function to be called when the file has been successfully appended. |
errorCallback | Function | You can set here an optional JavaScript function to be called if some error occur while append text into the file. This function receives an "error" variable with an error object. |
You can use this plugin method to easily read the contents of an existing text file. This method admits the below arguments:
Name | Type | Description |
---|---|---|
dirPath | String | The directory path in which the file resides. |
fileName | String | The file name that you want to read, for example, "myFile.txt" or "myFile.json". |
successCallback | Function | You must set here a JavaScript function which is called once the file has readed. This function receive the file contents in their unique argument. |
errorCallback | Function | You can set here an optional JavaScript function to be called if some error occur while read the text file. This function receives an "error" variable with an error object. |
You can use this plugin method to get a file blob (ready to be uploaded to the app server, for example) based in a file URI. The Camera plugin, for example, give us the file URI of a captured image. We can use this file URI directly, to show the image in the app, and, also can convert that file URI into a file blob, in order to be uploaded to the app server.
Name | Type | Description |
---|---|---|
fileUrl | String | The file URL to be returned as a blob. |
successCallback | Function | You must set here a JavaScript function which is called once the file blob is ready. This function receive the file blob in their unique argument. |
errorCallback | Function | You can set here an optional JavaScript function to be called if some error occur while prepare the file blob. This function receives an "error" variable with an error object. |
You can use this plugin method (only for iOS) in order to convert a file URL (file://) to an appropriate URL to be used in Image, Audio Player, Video Player, controls, etc. The method returns the converted URL ready to use.
Name | Type | Description |
---|---|---|
fileUrl | String | The file URL to be converted. |
The Apache Cordova Media plugin allows to record an audio without the need of any external app, like the Media capture use.
Use this plugin method to start the recording of an audio. Note that this plugin method requires to create a file first, which you must do by using the app.cordova.file.createFile() method. In order to use this plugin, you must also check the "File plugin" checkbox in the app's options. This plugin method returns a media object instance, that you must use later to stop the recording (see below).
Name | Type | Description |
---|---|---|
fileUrl | String | A previously created file URL in order to store the recorded audio. |
successCallback | Function | This function callback is executed if everything is fine, once you call to the app.cordova.media.stopRecord() method. |
errorCallback | Function | You can set an optional function callback to be executed if an error occur while the recording. This function receives an "error" variable with an error object. |
If you want to upload the recorded audio to your app server, you can do it by using the app.cordova.file.getFileBlobFromFileUrl() method.
Use this method to stop a previously started audio recording with the app.cordova.media.startRecord() method. This method requires the below arguments:
Name | Type | Description |
---|---|---|
mediaInstance | object | You must specify here a media object instance, which has been previously returned by the app.cordova.media.startRecord() method. |
The Apache Cordova Device plugin provides to you information about the device in which your app is running. This plugin put available the below JavaScript methods to retrieve the device information.
Use this plugin method to retrieve the name of the device's model or product. The value is set by the device manufacturer and may be different across versions of the same product.
Use this plugin method to retrieve the device's operating system name.
Use this plugin method to retrieve the device's Universally Unique Identifier (UUID).
Use this plugin method to retrieve the device's operating system version.
Use this plugin method to retrieve the device's manufacturer.
Use this plugin method to retrieve the device is running on a simulator.
Use this plugin method to retrieve the device hardware serial number.
You can use the Apache Cordova plugins in order to show to the user customizable natives dialogs and also alert it with a device's "beep". Note that all the methods provided by this Apache Cordova plugin fallback in the native "alert", "confirm" and "prompt" JavaScript functions, so this plugin can be used also in non Apache Cordova platforms. For the "beep" method this plugin fallback to the app.beep() app method. This is a very easy to use and useful plugin that offers to you the below methods ready to be used:
Use this plugin method to show to the user a customizable native alert dialog. This method admits the below arguments:
Name | Type | Description |
---|---|---|
message | String | The message to the user to be shown in the alert dialog. |
title | String | Set an optional title for the alert dialog. The default title is "Alert". |
dismissCallback | Function | Set an optional JavaScript function to be called when the user dismiss the alert dialog. |
buttonLabel | String | Set an optional label for the alert dialog button. The default title is "OK". |
Use this plugin method to show to the user a customizable native confirmation dialog. This method admits the below arguments:
Name | Type | Description |
---|---|---|
message | String | The message to the user to be shown in the confirmation dialog. |
title | String | Set an optional title for the confirmation dialog. The default title is "Confirm". |
confirmCallback | Function | Set a JavaScript function to be called when the user dismiss or press one of the available dialog buttons (see below). This function receives one argument with the index of the pressed button, or "0" (zero) if the user dismiss the dialog without press any button. |
buttonLabels | Array of strings | Set an optional labels for the dialog buttons. By default the buttons are "[OK, Cancel]". |
Use this plugin method to show to the user a customizable native prompt dialog. This method admits the below arguments:
Name | Type | Description |
---|---|---|
message | String | The message to the user to be shown in the prompt dialog. |
title | String | Set an optional title for the prompt dialog. The default title is "Prompt". |
promptCallback | Function | Set a JavaScript function in order to be called when the user press one of the available dialogs button or when dismiss the dialog without pressing any button. This function receives one object variable argument with two properties: "buttonIndex", with the pressed dialog button or "0" zero if the dialog has been dismissed without pressing any button; and the object property "input1", which stores the text entered by the user in the prompt dialog. |
buttonLabels | Array of strings | Set an optional labels for the dialog buttons. By default the buttons are "[OK, Cancel]". |
defaultText | String | Set the default text to be shown in the prompt dialog input box when the dialog is show. |
Use this plugin method to play a device "beep" the specified number of times. Note that some devices like Android can play the established notification tone instead of a classical beep. This method admits the below arguments:
Name | Type | Description |
---|---|---|
times | Number | Specify the number of times that you want to play the beep sound. |
The Apache Cordova Vibration plugin allows to perform a vibration or a vibration pattern in the user device, as well to cancel a performing vibration. This plugin provides to you the below methods:
Use this plugin method to perform a vibration in the user device during the specified milliseconds.
Name | Type | Description |
---|---|---|
milliseconds | Number | Specifies the number of milliseconds to vibrate the device. |
Use this plugin method to perform a vibration in the user device using the specified pattern.
Name | Type | Description |
---|---|---|
pattern | Array of numbers | A sequence of numbers to be used as the pattern for the vibration (see an example below). |
Use this plugin method to cancel a performing vibration or vibration pattern.
The Apache Cordova Camera plugin allows to get a picture from the user device, directly taken from the device camera or picked from the device photo album. We can get the taken image URI, in order to be show in the app. We can also get the Base64 string representation of the taken image, and, with the help of the Apache Cordova File plugin, we can get a blob object from the taken image, ready to be uploaded to the app server, for example. This plugin provides to you the below variables and methods:
This is an object variable that stores the possible source type value to be used in the configuration variable to be passed to the app.cordova.camera.getPicture() method. This object variable provide the below properties / values to be used:
Name | Type | Description |
---|---|---|
PHOTOLIBRARY | Number | Choose image from the device's photo library (same as SAVEDPHOTOALBUM for Android). |
CAMERA | Number | Take picture from camera. |
SAVEDPHOTOALBUM | Number | Choose image only from the device's Camera Roll album (same as PHOTOLIBRARY for Android) . |
This is an object variable that stores the possible destination type value to be used in the configuration variable to be passed to the app.cordova.camera.getPicture() method. This object variable provide the below properties / values to be used:
Name | Type | Description |
---|---|---|
DATA_URL | Number | Return base64 encoded string. DATAURL can be very memory intensive and cause app crashes or out of memory errors. Use FILEURI or NATIVE_URI if possible. |
FILE_URI | Number | Return file uri (content://media/external/images/media/2 for Android). |
This is an object variable that stores the possible encoding type value to be used in the configuration variable to be passed to the app.cordova.camera.getPicture() method. This object variable provide the below properties / values to be used:
Name | Type | Description |
---|---|---|
JPEG | Number | Return JPEG encoded image. |
PNG | Number | Return PNG encoded image. |
This is an object variable that stores the possible media type value to be used in the configuration variable to be passed to the app.cordova.camera.getPicture() method. This object variable provide the below properties / values to be used:
Name | Type | Description |
---|---|---|
PICTURE | Number | Allow selection of still pictures only. Will return format specified via DestinationType. |
VIDEO | Number | Allow selection of video only, ONLY RETURNS URL. |
ALLMEDIA | Number | Allow selection from all media types. |
This is an object variable that stores the possible direction value to be used in the configuration variable to be passed to the app.cordova.camera.getPicture() method. This object variable provide the below properties / values to be used:
Name | Type | Description |
---|---|---|
BACK | Number | Use the back-facing camera. |
FRONT | Number | Use the front-facing camera. |
This is an object variable that stores the default configuration object to be used when call to the app.cordova.camera.getPicture() method. You can modify a bit this variable and then pass to the referred method, or creates a similar object variable, in order to be used in that method.
Name | Type | Description |
---|---|---|
quality | Number | Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.). |
destinationType | Number | Choose the format of the return value. One of the "app.cordova.camera.destinationType.*" values. |
sourceType | Number | Set the source of the picture. One of the "app.cordova.camera.sourceType.*" values. |
allowEdit | Boolean | Allow simple editing of image before selection. |
encodingType | Number | Choose the returned image file's encoding. |
targetWidth | Number | Width in pixels to scale image. Must be used with targetHeight. Aspect ratio remains constant. |
targetHeight | Number | Height in pixels to scale image. Must be used with targetWidth. Aspect ratio remains constant. |
mediaType | Number | Set the type of media to select from. Only works when "sourceType" is "PHOTOLIBRARY" or "SAVEDPHOTOALBUM". |
correctOrientation | Boolean | Rotate the image to correct for the orientation of the device during capture. |
saveToPhotoAlbum | Boolean | Save the image to the photo album on the device after capture. |
cameraDirection | Number | Choose the camera to use (front- or back-facing). |
Use this plugin method to take a picture from the user device, taking it from the device's camera or the device's photo album. This plugin admits the below arguments:
Name | Type | Description |
---|---|---|
successCallback | Function | Set a JavaScript function to be called when the picture has been successfully taken. This function receives one argument with the returned picture. The returned type depend on the "destinationType" configuration variable and can be a file URI and also the Base64 representation of the taken picture. |
errorCallback | Number | Set a JavaScript function to be called if some error occur while the picture is taken. The function receives one argument with information about the error. Note that this function is also called if the user just cancel the selection of the picture. |
config | Object | An object that set the configuration for the method. You can use here the default configuration variable, modify a bit that variable, or just pass a similar variable to the method. |
You can use this plugin method (only for iOS) in order to convert a file URL (file://) to an appropriate URL to be used in Image, Audio Player, Video Player, controls, etc. The method returns the converted URL ready to use.
Name | Type | Description |
---|---|---|
fileUrl | String | The file URL to be converted. |
The Apache Cordova InAppBrowser plugin provides to you a way to show contents in an external but controlable browser window. Below you can see the JavaScript method who this plugin provides to you, as well as usage sample code.
Use this plugin method to show contents on an external browser window. This method admits the below arguments:
Name | Type | Description |
---|---|---|
url | String | The URL to load. Call encodeURI() on this if the URL contains Unicode characters. |
target | String |
The URL to load. Call encodeURI() on this if the URL contains Unicode characters. This argument can be one of these values:
|
options | String |
Specify the options to be used. Default value is: "location=yes". This argument can be The options string must not contain any blank space, and each feature's name/value pairs must be separated by a comma. Feature names are case insensitive. All platforms support:
The Android platform supports these additional options:
The iOS platform supports these additional options:
The Windows platform supports these additional options:
|
The Apache Cordova Screen Orientation plugin provides to you a way to change and lock the device screen orientation at runtime. You can establish the default screen orientation to be used at designtime, from the Apache Cordova Configuration options. This plugin put also available the app OrientationChange event.
This is an object variable that stores all the possible values to be used with the app.cordova.screenOrientation.lock() method. This object variable provide the below properties / values to be used:
Name | Type | Description |
---|---|---|
portraitPrimary | String | The orientation is in the primary portrait mode. |
portraitSecondary | String | The orientation is in the secondary portrait mode. |
landscapePrimary | String | The orientation is in the primary landscape mode. |
landscapeSecondary | String | The orientation is in the secondary landscape mode. |
portrait | String | The orientation is either portrait-primary or portrait-secondary (sensor). |
landscape | String | The orientation is either landscape-primary or landscape-secondary (sensor). |
any | String | The screen orientation is unlocked - all orientations are supported. |
You can use this plugin method to lock the screen orientation to one of the "app.cordova.screenOrientation.orientation.*" values. This method admits the below argumens:
Name | Type | Description |
---|---|---|
orientation | String | One of the "app.cordova.screenOrientation.orientation.*" values. |
You can use this plugin method to unlock the screen orientation.
You can use this plugin method to know the current established screen orientation. This method returns one of the "app.cordova.screenOrientation.orientation.*" values.
The Apache Cordova Battery Status plugin provides information about the device battery level, as well to know if the device is plugged or not. This plugin provides the below app events:
The Apache Cordova Battery Status plugin provides also the below variables:
This variable is available in the related battery app events and stores a number which represents the percentage of the device's battery level, that can be from 0 to 100.
This variable is available in the related battery app events and stores a boolean value which means that the device is plugged in ("true") or not ("false").
The Apache Cordova Geolocation plugin provides information about the device geolocation. This plugin provides the below variables and methods:
This is an object variable that stores the default configuration that can be used with the app.cordova.geolocation.getCurrentPosition() method and the app.cordova.geolocation.watchPosition() method. You can modify this variable or creates a similar one in order to be passed to these methods. This variable have the below properties:
Name | Type | Description |
---|---|---|
maximumAge | Number | Accept a cached position whose age is no greater than the specified time in milliseconds. |
timeout | Number | The maximum length of time (milliseconds) that is allowed to pass from the call to the app.cordova.geolocation.getCurrentPosition() method or the app.cordova.geolocation.watchPosition() method until the corresponding "successCallback" executes. If the "successCallback" callback is not invoked within this time, the "errorCallback" callback is passed a "TIMEOUT" error code. (Note that when used in conjunction with app.cordova.geolocation.watchPosition() method, the "errorCallback" callback could be called on an interval every timeout milliseconds!). |
enableHighAccuracy | Boolean | Provides a hint that the application needs the best possible results. By default, the device attempts to retrieve a Position using network-based methods. Setting this property to true tells the framework to use more accurate methods, such as satellite positioning. |
You can use this plugin method to get the current geolocation information of the device. This method admits the below arguments:
Name | Type | Description |
---|---|---|
successCallback | Function |
Set a JavaScript function to be called when the plugin retrieves the device geolocation information. This function receives one "position" object variable argument with the below properties:
|
errorCallback | Function |
Set a JavaScript function to be called if an error occur and . This function receives one "error" object variable argument with information about the error:
|
config | Object |
The optional configuration / options object for the method. You can use the default values or change the default of the app.cordova.geolocation.config object variable. |
You can use this plugin method watch the device geolocation information until you call to the app.cordova.geolocation.clearWatch() method. This method support the same arguments than the app.cordova.geolocation.getCurrentPosition() method described above. This method returns a number variable that you can pass later to the app.cordova.geolocation.clearWatch() method.
You can use this plugin method to stop to watch for the device geolocation information started with the app.cordova.geolocation.watchPosition() method. This method admits the below arguments:
Name | Type | Description |
---|---|---|
watchID | Number | An identifier variable as is returned by the app.cordova.geolocation.watchPosition() method. |
The Apache Cordova NetWork Information plugin provides information about the current network connection type of the device. Additionally, by using this plugin in your app the Online event and the Offline event are properly attached and can be fired accordingly when the device loss or recover the network connection.
This plugin variable is an object which contains all the possible network connection values that can be returned by the app.cordova.network.getConnectionType() method.
You can use this plugin method to retrieve the current network type of the device. This method returns one of the values provided by the app.cordova.network.connectionTypes variable.
The Apache Cordova Statusbar plugin provides to you several ways to customize the device's statusbar. You can set various statusbar related options at designtime from the Apache Cordova - Configuration options. Use the methods of this plugin to change the device's statusbar at runtime.
You can use this plugin method to hide the device's statusbar at runtime. This method don't require any arguments.
You can use this plugin method to show the device's statusbar at runtime. This method don't require any arguments.
You can use this plugin method to check if the device's statusbar is visible or not. This method don't require any arguments.
You can use this plugin method to use the default statusbar style (dark text, for light backgrounds). This method don't require any arguments.
You can use this plugin method to use the light content statusbar style (light text, for dark backgrounds). This method don't require any arguments.
You can use this plugin method to set the statusbar background color to one of the supported color names. This method admits the below arguments:
Name | Type | Description |
---|---|---|
colorName | String | This argument can be one of these color names: black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple or brown. |
You can use this plugin method to set the statusbar background color by using an HTML hex string color. This method admits the below arguments:
Name | Type | Description |
---|---|---|
colorHexStr | String | An HTML color to be used, for example, "#C0C0C0". Also admits short colors like: "#333". |
You can use this plugin method to make the statusbar overlay or not overlay the WebView. This method admits the below arguments:
Name | Type | Description |
---|---|---|
overlays | Boolean | Set to "true" to make the statusbar overlay on top of your app. Ensure that you adjust your styling accordingly so that your app's title bar or content is not covered. Set to "false" to make the statusbar solid and not overlay your app. You can then set the style and background color to suit using the other functions. |
The Apache Cordova Media Capture plugin provides to you the right methods to capture images, audio and video from the user device. Take a look below at the provided plugin methods:
You can use this plugin method to start the audio recorder application and return information about captured audio clip file.
Name | Type | Description |
---|---|---|
successCallback | Function |
Set this argument to a JavaScript function to be called when the clip audio has been taken. The function receives one object variable as an argument with information about the selected files, in this case always an array with a sole item, with information of the taken audio. Take a look at the properties availables in the the item of this function's argument:
|
errorCallback | Function |
Set this argument to a JavaScript function to be called if an error occurs while capture the audio. The function receives one object variable as an argument with the error information. Below you can see the possible errors:
|
You can use this plugin method to start the video recorder application and return information about captured video clip file.
Name | Type | Description |
---|---|---|
successCallback | Function |
Set this argument to a JavaScript function to be called when the clip video has been taken. The function receives one object variable as an argument with information about the selected files, in this case always an array with a sole item, with information of the taken video. Take a look at the properties availables in the the item of this function's argument:
|
errorCallback | Function |
Set this argument to a JavaScript function to be called if an error occurs while capture the video. The function receives one object variable as an argument with the error information. Below you can see the possible errors:
|
You can use this plugin method to capture an image and retrieves information about captured image file. Note that you can also use the Apache Cordova Camera plugin to capture a picture from the user device.
Name | Type | Description |
---|---|---|
successCallback | Function |
Set this argument to a JavaScript function to be called when the image has been captured. The function receives one object variable as an argument with information about the selected files, in this case always an array with a sole item, with information of the captured image. Take a look at the properties availables in the the item of this function's argument:
|
errorCallback | Function |
Set this argument to a JavaScript function to be called if an error occurs while capture the image. The function receives one object variable as an argument with the error information. Below you can see the possible errors:
|