Kony Visualizer supports the creation of Apache Cordova apps. Cordova is an open-source development framework for mobile applications that rely on JavaScript, HTML5, and CSS3 rather than the APIs that are specific to a given platform, such as iOS and Android. The layout of a Cordova app is rendered using web views rather than any platform's native UI framework, and yet unlike web apps, they're capable of accessing native APIs and are bundled as apps for publication. For these reasons, Cordova applications are hybrid in nature, being neither native to a particular platform, nor entirely web-based, and are capable of mixing native and web-based code snippets.
Kony Visualizer supports internationalization in Cordova applications.
Creating a Cordova app involves the following tasks:
To enable Cordova, do the following:
Important: Changing the Cordova CLI version may affect your application code.
Kony Visualizer creates a Cordova folder structure accessible on the Project tab of the Project Explorer, under the Web section.
With Kony Visualizer, you can import existing Cordova content or create new content.
You can import an entire existing Cordova project into Kony Visualizer, or import one or more assets into individual Cordova folders.
To import an entire existing Cordova project into Kony Visualizer, do the following:
Kony Visualizer imports the Cordova assets into the Cordova file structure within your Kony Visualizer project.
To import one or more assets into individual Cordova folders, do the following:
The file or files you selected are imported into that folder.
To create Cordova assets, do the following:
In the case of a folder, a new folder is added. In the case of a file, a new file is opened in the code editor. You can rename the file or folder by clicking its context menu arrow in the Project Explorer, clicking Rename, and then entering the name you want.
To make Cordova content accessible to the user of your app, you add a Cordova browser widget to a form. For information about its properties, see Cordova Browser.
To add a Cordova browser widget to a form, do the following:
A Cordova plugin is a code module that extends Cordova's functionality beyond what is available in a purely web-based app, giving your Cordova context an interface to a device's native components and capabilities, such as the battery status or camera.
Cordova plugins can either be added or imported. When you add a plugin in Kony Visualizer, you are in fact fetching it from the Apache Cordova web site. Kony Visualizer searches the Cordova plugin catalog and lists the available plugins so that you can add the ones you want. In contrast, when you import a Cordova plugin into a Kony Visualizer project, you browse your computer for a plugin that you have already downloaded.
By default, a number of Cordova plugins are supported in Kony Quantum App. For more information, see Default Cordova Plugins for Kony Quantum App.
To add Cordova plugins, do the following:
To import Cordova plugins, do the following:
Kony Visualizer by default supports the following plugins for Kony Quantum App:
Battery | Device | Network Information |
BlueTooth LE | Device Motion | Notification |
Camera | Device Orientation | Push |
Capture | File | Splashscreen |
CodePush | File Transfer | StatusBar |
Console | Geolocation | Vibration |
Contacts | Globalization | Whitelist |
Cordova SQLite storage | InAppBrowser | |
CrossWalk WebView engine | Media |
To ensure the best performance and security, it is recommended that you adhere to the following best practices.
With Kony Visualizer, a Cordova application can invoke Kony Fabric services. And if your application requires it, you can invoke Kony Fabric services from both a Cordova context and a native context.
If your Kony Visualizer project includes both native forms and Cordova forms, it is best to invoke Kony Fabric services from the native context, and then pass the required data to the Cordova browser widget.
To prevent the execution of any unverified JavaScript functions on a device, any functions that are invoked for use in the Browser or Cordova Browser widgets should exist in the underlying JavaScript files of your project.
While integrating your Cordova-generated Android project, certain gradle dependency conflicts or android.support
to androidx
conversion issues can arise. From Kony Visualizer V8 SP4 Fixpack 47, you can manually customize this Cordova project and then resolve these issues.
You can bundle this customized Cordova project by specifying the cordovabuildmode
property as incremental
in the androidbuild.properties
file. For more information about the cordovabuildmode
property, click here.
To manually customize your Cordova-generated Android project, follow these steps:
android.support
references or due to some other build conflicts), you must copy all the contents in the <konyproject>\cordovatemp\platforms\android
folder to the <konyproject>/cordovaprebuilt
folder.
Note: If you face any android.support
to androidx
conflicts, you can manually change those references. Alternatively, with Android Studio 3.2 and later, you can migrate an existing project to AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar. This action converts all android.support
references to androidx
.
cordovabuildmode
property as incremental
in the androidbuild.properties
file, which is located at: <konyproject>/androidbuild.properties.Note: If you do not specify the cordovabuildmode
property, the <konyproject>/cordovaprebuilt
folder will be ignored.
Note: If you specify the cordovabuildmode
property, the <konyproject>/cordovaprebuilt
folder must be available; otherwise, the build will fail.
While developing Cordova supported applications in Kony Visualizer, you might see the following errors due to memory-related issues.
Execution failed for task ':mergeDebugResources'
Error: java.util.concurrent.ExecutionException: java.io.IOException: The pipe is being closed
Follow the steps below to fix the problem:
%userprofile%
on Windows machines and ~/
on Macs.org.gradle.jvmargs=-Xms512M -Xmx4g -XX:MaxPermSize=2048m -XX:MaxMetaspaceSize=1g -Dkotlin.daemon.jvm.options="-Xmx1g"
gradle -- stop
on your machine. This action stops the Gradle process and unlocks any locked files by Gradle.
Rev | Author | Edits |
7.1.1 | NMK | NMK |
Copyright © 2013 Kony, Inc. All rights reserved. |