Eclipse IDE

HP provides plug-ins to the Eclipse IDE to facilitate webOS application development. Eclipse is a popular Integrated Development Environment (IDE) that is applicable to many languages and programming techniques. Eclipse's architecture allows plug-ins to provide custom capabilies within the IDE. The Palm plug-in adds the capability to create app and scene frameworks automatically, and to load and run the app on either a device or the emulator.

Before You Begin

Installing Eclipse and the webOS Plug-In

This section describes how to install and update Eclipse.

Note: If you are using an earlier version of Eclipse, you must upgrade to Eclipse 3.5 or later to get the new plug-ins for webOS development.

Installing Eclipse

  1. Download the latest version of Eclipse here. The correct version is Eclipse IDE for JavaScript Web Developers. Download the appropriate version for your operating system and extract to any location. Eclipse will run from the extracted folder.
  2. Start Eclipse.
  3. When prompted for a workspace location, accept the default (/home/YOUR_USER_NAME/workspace).

Note: The workspace location must be an absolute path with no spaces.

Finding and installing updates

  1. Select Help > Install New Software.
  2. In the Available Software dialog, click Add...
  3. In the Location field, type https://cdn.downloads.palm.com/sdkdownloads/eclipse-update-site/site.xml, and then click OK. (If you are unable to connect to this site, see the Local download instructions below.)
  4. Open the new site in the list, expand Palm webOS SDK, and click the Palm webOS SDK check box.
  5. Click Install... and accept the license agreements.
  6. When the Install dialog comes up, make sure Palm webOS SDK is selected, and click Finish.
  7. Restart Eclipse when prompted.

Installing the Aptana Plug-In

To improve the development experience, HP recommends installing the Aptana Studio plug-in. The Aptana plug-in provides HTML, JavaScript, and CSS functionality to Eclipse.

To install Aptana after installing Eclipse, go to www.aptana.com and click on the "Download" link. On the "Download" page, select "Eclipse Plug-in Version" and then follow the instructions given.

Using Eclipse with the Plug-Ins

This section describes how to run Eclipse and use the debug launch configuration.

Starting Eclipse

Follow these instructions to start Eclipse:

Selecting the webOS Perspective

Eclipse has several perspectives, or views, from which to choose. You want to work in the webOS perspective.

To select the perspective:

  1. Select Window > Open Perspective > Other...
  2. Select webOS, and then click OK.

Generating a webOS Application

Note: You can also use the New Mojo application icon in the Workbench toolbar to create an application or scene.

Creating a new webOS application

  1. Select File > New > Basic Application.
  2. In the Project Name field, type a name and the following:

    • Title
    • Vendor
    • Id
    • Version
  3. Click Finish.

Adding a scene to the application

  1. Select File > New > Basic Scene.
  2. Select the project.
  3. In the Name field, type the name of the scene, and then click Finish.

Starting the application

  1. Select Run > Run Configurations....
  2. Select Mojo Application, and then click the New launch configuration icon.
  3. In the Name field, type the name.
  4. Click the Project arrow to select the project.
  5. Click the Target arrow and select one of the following:
    • Palm Emulator, if you are using the emulator
    • Palm Device, if you are using a device (ensure the device is in Developer Mode)
  6. Click Run.

Note that a launch shortcut is also available. Select the project and Run > Run As > Mojo Application. If you previously created a launch configuration, that target is used. Otherwise, a dialog box pops up so you can select a target.

Debugging a Mojo application

Note: The following instructions only apply to Mojo applications. For source-level debugging of Enyo applications, try the Ares Debugger. (If you are running in the emulator, another useful technique is to use your browser's inspection capabilities via Emulator Host Mode.)

  1. Select Run > Debug Configurations.

  2. Select Mojo Application, and then click the New launch configuration icon.

  3. In the Name field, type the name.

  4. Click the Project arrow to select the project.

  5. Click the Target arrow and select one of the following:
    • Palm Emulator, if you are using the emulator.
    • Palm Device, if you are using a device.
  6. In the Debug Options area, select Mojo debugging, which enables debug logging in the Mojo framework. This is equivalent to the following command:

    palm-launch -p "{mojoConfig: {debuggingEnabled:true}}"<appid>
    
    
  7. Click Debug.

Note that a launch shortcut is also available. Select the project and Run > Debug As > Mojo Application. If you previously created a launch configuration, that target is used. Otherwise, a dialog box pops up so you can select a target.

Staying Updated

When new Eclipse plug-ins are available (currently you are notified through email), you can install them through the Eclipse Update Manager as follows:

  1. Select Help > Check for Updates.
  2. Select Palm webOS SDK and click Update...
  3. Click Install and accept the license agreements.
  4. Restart Eclipse when prompted.