Develop and Configure

Version added 07-Mar-2018| Modified 10-Jun-2019

To create a built-in web app, you must write the source code and prepare the required configuration files.

For easier understanding, the process to create a built-in web app is explained using the example of a web app named that responds with the string "Hello, Web Application!!".

The directory structure of must be as follows:
├── CMakeLists.txt
├── appinfo.json
├── icon.png
├── index.html
└── webOSjs-0.1.0
    ├── LICENSE-2.0.txt
    └── webOS.js


Before you begin developing the built-in web app, you must:

  • Build and flash the webOS OSE image. For detailed information, see Building webOS OSE and Flashing webOS OSE.

  • Create a project directory ( for the sample web app.

$ mkdir

Developing the Web App

You can develop a web app using standard web technologies. 

Web apps built for webOS devices can also provide enhanced functionality by leveraging the APIs provided by webOS services. Let us understand this with a sample code that prints a hello message and also prints the current time on the log.

Prerequisite (when calling webOS service in the web app): Download the webOS library file from and decompress it to the source code directory. This library is required to call LS2 API.

For the sample web app (, create the index.html  file in the project root directory.

<!DOCTYPE html>
<style type="text/css">
body {
                width: 100%;
                height: 100%;
                background-color: #202020;
div {
                display: table;
h1 {
            display: table-cell;
                vertical-align: middle;
                color: #FFFFFF;
        <script src="webOSjs-0.1.0/webOS.js" charset="utf-8"></script>
        <script type="text/javascript">
        //sample code for calling LS2 API
        var lunaReq= webOS.service.request("luna://com.webos.service.systemservice",
            onSuccess: function (args) {
      "GETTIME_SUCCESS", {"APP_NAME": "example web app"}, "UTC : " + args.utc);
            onFailure: function (args) {
                webOS.error("GETTIME_FAILED", {"APP_NAME": "example web app"}, "errorText : " + args.errorText);
                <h1>Hello, Web Application!!</h1>

A brief explanation of the above file::

  • Line(23) : Include the webOs library.

  • Line(25~36) : Call systemserivce/clock/getTime method. If the response is successful, print "UTC" to log file. (/var/log/messages). For details, refer to Using PmLog in JavaScript.

This file provides general information of the web app. For the sample web app (, you must:

  • Create and update the file :

    • Directory : 

If the file is missing, a build error occurs.
Make sure the 'Summary' subsection is a single line. Even a blank space before the 'Description' section is considered a part of the summary and can cause the build to fail. 
Here is a snippet of the file that will not cause a build error. Any whitespace character in the red-colored line would cause a build error.

web app sample
(no blank space)

Sample File

web app sample

web app sample

How to Build on Linux

## Dependencies

Below are the tools and libraries (and their minimum versions) required to build sample program:

* cmake (version required by cmake-modules-webos)
* gcc
* glib-2.0
* make
* cmake-modules-webos

## Building

    $ cd build-webos
    $ source oe-init-build-env
    $ bitbake

Copyright and License Information
Unless otherwise specified, all content, including all source code files and
documentation files in this repository are:

Copyright (c) 2018 LG Electronics, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

SPDX-License-Identifier: Apache-2.0

Configuration Files

This section describes how to prepare the configuration files required to build and test the built-in web app.


Apps are required to have metadata before they can be packaged. This metadata is stored in a file called appinfo.json, which is used by the webOS device to identify the app, its icon, and other information that is needed to launch the app. For the sample web app (, you must:

  • Create and update the file : appinfo.json

    • Directory :

  "id": "",
  "version": "0.0.1",
  "vendor": "My Company",
  "type": "web",
  "main": "index.html",
  "title": "Web app sample",
  "icon": "icon.png",
  "requiredPermissions" : ["time"]

A brief explanation of the above file:

  • Line(2) : The ID for the app.

  • Line(5) : The type of the web app.

  • Line(7) : The title to be shown on the Home Launcher app.

  • Line(8) : The icon to be shown on the Home Launcher app. Make sure the icon file is available in the project root directory. You can use your own icon.png (80*80) file or attached icon.png.

  • Line(9) : Specify the group to which the external service's method called by the app belongs. Because systemservice's getTime method belongs to "time" group, put "time" in this property. To check the group of each method, use ls-monitor command with "-i" option.

For more details, see appinfo.json.


This file is required to generate the standard build files. For the sample web app (, you must:

  • Create and update the file : CMakeLists.txt

    • Directory :

cmake_minimum_required(VERSION 2.8.7)
project( NONE)
webos_modules_init(1 0 0 QUALIFIER RC4)
#install necessary files to destination directory
        PATTERN "*~" EXCLUDE
        PATTERN "CMake*" EXCLUDE
        PATTERN "build*" EXCLUDE
        PATTERN "oe-*" EXCLUDE
        PATTERN "*.lock" EXCLUDE)

A brief explanation of the above file:

  • Line(2) : Specify the project name and the file extension type. In this tutorial, we use "" as the project name for indicating various filenames and pathnames. The file extension type "NONE" allows CMake to skip unnecessary compiler checks.

  • Line(3) : Include webOS OSE modules for the build.

  • Line(4) : Specify the "cmake-modules-webos" version.

  • Line(6) : The built-in app must have source codes, appinfo.json, and icon files for each application name in /usr/palm/applications/ on the target. To install the files to the target, set /usr/palm/applications/ as the path.

  • Line(8~14) : Install the required files to /usr/palm/applications/ on the target. Exclude the files that do not have to be installed to the target device. 

Except as noted, this content is licensed under Creative Commons Attribution 4.0 and sample code is licensed under Apache License 2.0.