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.
Prior to installing Eclipse and the plug-ins, you need to install the HP webOS SDK and the webOS emulator. If you have not done this yet, go to the SDK download page and click on "Download SDK" to be taken to the correct page for your platform. Be sure to follow the instructions in order, or the emulator may not work correctly.
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
- 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.
- Start Eclipse.
- 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
- Select Help > Install New Software.
- In the Available Software dialog, click Add...
- 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.)
- Open the new site in the list, expand Palm webOS SDK, and click the Palm webOS SDK check box.
- Click Install... and accept the license agreements.
- When the Install dialog comes up, make sure Palm webOS SDK is selected, and click Finish.
- Restart Eclipse when prompted.
Installing the Aptana Plug-In
To improve the development experience, Palm 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:
- Linux: At the command prompt, type eclipse
- Mac: In the Eclipse folder (inside the Applications folder), double-click Eclipse.
- Windows: Find and open eclipse.exe (its location depends on where you installed 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:
- Select Window > Open Perspective > Other...
- 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
- Select File > New > Basic Application.
-
In the Project Name field, type a name and the following:
- Title
- Vendor
- Id
- Version
-
Click Finish.
Adding a scene to the application
- Select File > New > Basic Scene.
- Select the project.
- In the Name field, type the name of the scene, and then click Finish.
Starting the application
- Select Run > Run Configurations....
- Select Mojo Application, and then click the New launch configuration icon.
- In the Name field, type the name.
- Click the Project arrow to select the project.
- 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)
- 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.)
-
Select Run > Debug Configurations.
-
Select Mojo Application, and then click the New launch configuration icon.
-
In the Name field, type the name.
-
Click the Project arrow to select the project.
- 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.
-
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> -
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:
- Select Help > Check for Updates.
- Select Palm webOS SDK and click Update...
- Click Install and accept the license agreements.
- Restart Eclipse when prompted.
Enabling Developer Mode
To install and test applications on a HP webOS device, you need to enable Developer mode on the device.
Note: Locking the phone with a PIN does not protect data on the device in Developer mode. When Developer mode is enabled, it is possible to use tools such as novaterm to access the device through the USB even if the phone is locked.
Enabling Developer mode, webOS 1.0-1.4.5
- In Card view or in the Launcher application, type the following: upupdowndownleftrightleftrightbastart
- Tap the resulting Developer Mode Enabler icon.
- In the application, move the Developer Mode slider to the On position.
- Tap Reset the Device. When reset is complete, Developer mode is enabled.
Enabling Developer mode, webOS 2.0
- Go to the phone app.
- On a GSM phone, press "#*DEVMODE#", followed by the call button. On a CDMA phone, press "##DEVMODE#". (If the device is GSM, and there is no SIM card, a screen may be displayed instructing you to install one. Just begin typing the "#*" and the phone app will appear.)
- The Developer Mode scene will be displayed.
- Select "On". You will be prompted to reboot the device.