# appinfo.json

## Overview

The root of the application folder contains the `appinfo.json` document. It is a JavaScript file containing a JSON object. If the application is localized into more than one language, each language can have its own `appinfo.json`. However, the application title and version number in each localized `appinfo.json` must be the same as in the top-level `appinfo.json`. The application title and version in the top-level `appinfo.json` are validated for correct value and structure. Any application that fails the validation cannot be packaged or uploaded.

A note about JSON syntax:

- Do not include any comments in json files (/* or //)
- Use double quotes around properties--no single quotes.

The following table lists the fields in `appinfo.json`.

## Fields

Property | Required | Description | Example
--- | --- | --- | ---
icon | No | This is a file path relative to the appinfo.json file. The default is icon.png. | "myicon.png"
id | Yes | This is the ID for this application. Every application has a unique ID, created from reverse DNS naming conventions. The launcher uses the ID to uniquely identify your application and displays it with the title above. The application ID is unique, set once, and cannot be changed after publishing the application. | "com.newco.app.myApp"
main | Yes | The launch point for the app. This is a file path relative to the `appinfo.json` file and needs to point to an HTML file. It defaults to index.html. | "index.html"
miniicon | No | Used for notifications. This is a file path relative to the `appinfo.json` file. The default is `miniicon.png`. | "mini-icon.png"
noDeprecatedStyles | No | When set to true, suppresses loading of the `global-deprecated.css` style sheet, slightly improving the framework load time. | true
noWindow | No | Is this app a headless app? (Default is `false`). Allowed values are `true` or `false`. | false
plug-ins | No | Indicator of whether or not an app makes use of PDK plug-ins. Set to `true` if so. | "true"
requiredMemory | No | Required if a PDK app. This is the maximum application memory usage in megabytes. | 30
theme | No | When set to "light" the dark CSS styles are not loaded, slightly improving the framework load time. | "dark"
title | Yes | The title of the application as it shows in the Launcher and the app window. The application title is unique, set once, and cannot be changed after publishing the application. | "myApp"
type | Yes | Identifies the type of application. Currently this should be set to "web" if an SDK-based app or hybrid app, or "pdk" if a PDK-based app. | "web"
vendor | Yes | A string representing the maker of the application. This is used in the launcher and deviceinfo dialogs. | "newco"
vendorurl | No | A string representing a URL that turns the vendor portion in deviceinfo dialogs to hyperlinks. |
version | Yes | The application version number, in the format ... The major, minor, and revision numbers are all mandatory non-negative integers. Leading zeros are stripped. The major, minor, and revision numbers are discrete. For example, 1.5.3 is a lower version than 1.15.3. After uploading an application, the same version cannot be uploaded again. To update and re-upload an application, you must increase the version number. | "1.0.3"

Although the framework does not use it, it is worth mentioning that the application launcher uses a params property, which it passes in its entirety to `ApplicationService.launch()`. The `appinfo.json` file can contain any other valid JSON a developer finds useful, which can then be accessed through Mojo.Controller.appInfo. For example, the Email and Calendar applications use this to specify an `lwStages` property that they pass to `createStageWithCallback()` to indicate whether or not lightweight stages should be used.

## App ID

The `appinfo.json` object gives the system the information it needs to load and launch your application. The most important property is id, which must be unique for each application. The ID is used in service calls to identify the caller and in other ways serves as a unique application identifier. We recommend a reverse DNS naming convention, but you can use other schemes if the ID is guaranteed to be unique.

The app id must consist only of lowercase letters (a-z), digits (0-9), plus and minus signs, and periods. It must be at least two characters long and must start with an alphanumeric character.

## Example

Here is a simple example of an `appinfo.json` object using the required fields and defaults. This is generated by the palm-generate command if you gave it "My App" as input for the application name.

>     {
>       "title":    "MyApp",
>       "type":     "web",
>       "main":     "index.html",
>       "id":       "com.yourdomain.app.myapp",
>       "version":  "1.0.3",
>       "icon":     "icon.png"
>     }

## Just Type Integration

See Configuring appinfo.json for Just Type for information on additional parameters required to integrate Just Type functionality into your app.