External QML apps are 3rd party QML apps that must be installed on the webOS target device. External QML apps can be created and deployed using the Command-Line Interface (CLI) tool that are provided by the webOS Open Source Edition (OSE) SDK.
This page describes the steps to develop an external QML app using CLI. For detailed information on the commands used in this tutorial, see CLI commands.
Creating QML Apps
Developing an external QML app requires the following steps:
Start by creating a QML app using one of the available QML app templates. These templates provide a starting point for developing the QML app.
To create a basic QML app, execute the following command:
$ ares-generate -t qmlapp sampleApp
In the above command:
qmlapp is the name of template that creates a basic QML app.
sampleApp is the QML app directory which is created in the current directory.
The QML app directory (sampleApp) has the following directory and files:
Directory / File
Configuration file that includes metadata for the QML app.
The icon image file. Can be replaced with a relevant icon.
The large icon image file. Can be replaced with a relevant icon.
QML application main page. This page only shows "Hello, QML Application!!" text on the screen.
If you already have an existing QML app that you want to deploy on a webOS OSE device, you must add the appinfo.json file to the app root directory. To create this file, enter the following CLI command:
$ ares-generate -t qmlappinfo sampleApp
Step 2: Implement the QML App
Design and implement the source code for the QML app.
By default, the basic QML app template includes some basic code that prints a “Hello, QML Application!!” message. Therefore, if you want to create a demo QML app to test this process, you can skip this step and proceed.
Note If you are packaging a JS service within the QML app and the JS service uses methods of external services, you must add the group information of the external methods used by the JS service to the requiredPermissions field in appinfo.json.
Step 4: Package the QML App
After implementing and configuring the QML app, it must be packaged as an IPK file. Make sure the appinfo.json file is available, because it is required when packaging a QML app for webOS OSE.
To package the QML app, use the ares-package command. The IPK file is generated in the current directory.
$ ares-package <APP_DIR> [<SERVICE_DIR>]
In the above command, <APP_DIR> and <SERVICE_DIR> mean app and service directories respectively. You can use an absolute or relative path for both <APP_DIR> and <SERVICE_DIR>. For details on using ares-package, see ares-package.
Packaging QML app only (relative path):
Windows: ares-package sampleApp
Linux/macOS: ares-package ./sampleApp
Step 5: Install the QML App
Before installing the app, you need to add the webOS OSE target device to the list of registered devices using the ares-setup-device command. For more information, see ares-setup-device. Skip this step if the target device is already present in the list.
To get a list of target devices only, use the command: ares-setup-device -list
To get a list of target device with all properties, use the command: ares-setup-device -listfull
Caution Make sure the webOS OSE target device is running during the installation.
To install the QML app on the target device, execute the following command: