Configuring JSON File

When you write an app, you need to define a configuration file called appinfo.json. If you create a service along with your app, you need to define a configuration file called service.json.

Now, if you create a project with the webOS TV IDE, there is no need to create your own appinfo.json file or services.json file. However, if you import a project without these two JSON files, you do need to create them on your own. The webOS TV IDE provides a config file template for appinfo.json and service.json which is the same as the webOS TV CLI provides. Read along to how you can set the JSON files.

APPINFO.JSON

The appinfo.json file contains app metadata and is used by webOS TV to determine the app information and to launch the app. For detailed information on the appinfo.json file, see appinfo.json.

ADDING APPINFO.JSON

As mentioned in the introduction, if your project is missing appinfo.json, you need to create it manually, by following one of the options below.

  • From the workbench menu bar, select webOS Menu > New > appinfo.json.
  • From the workbench menu bar, select File > New > Other.. > webOS > appinfo.json.
  • From the workbench toolbar, click the arrow next to the new wizard icon ide_new_wizard.png and select Other.. > webOS > appinfo.json.
  • Right-click on any place in the Project Explorer view, select New > Other.. > webOS > appinfo.json.

CONFIGURING APPINFO.JSON

To configure the appinfo.json file, first open the file by double clicking it from the Project Explorer view. (Note that if you just have created a project, the file is the first screen you will see, thus no need to open it.) The default tab you will see is the Overview tab. You can modify the file using either one of the tabs.

  • Using the Overview tab: This tab is comprised of user-friendly UI. You can only fill in the mandatory properties. However, you cannot add properties on this tab.
  • Using the appinfo.json tab: This tab shows a JSON object in its raw form. You can edit mandatory properties and add/edit optional properties on this tab.

 

The webOS TV IDE checks for syntax errors and provides warnings when you save your appinfo.json. You will see red and yellow icons on the code; these icons imply that the code has property name or value that are not supported. Make sure valid properties have been entered.

  • error.gif Indicates a syntax error
  • warning.gif Indicates a warning

SERVICES.JSON

The services.json file contains service metadata and defines what commands the service provides. Your service must have this file configured.

ADDING SERVICES.JSON

If your JS service project is missing services.json, you need to create it manually by following one of the options below.

  • From the workbench menu bar, select webOS Menu > New > services.json.
  • From the workbench menu bar, select File > New > Other.. > webOS > services.json.
  • From the workbench toolbar, click the arrow next to the new wizard icon ide_new_wizard.png and select Other.. > webOS > services.json.
  • Right-click on any place in the Project Explorer view, select New > Other.. > webOS > services.json.

CONFIGURING SERVICES.JSON

To configure the service.json file, open the file by double clicking it from the Project Explorer view. Unlike appinfo.json file, no user-friendly UI version for viewing the file is provided.

Check the service.json specification for valid properties.

Navigation