Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
542 lines (398 sloc) 20.2 KB
<div id="main" class="clearfix two-columns-right">
<div id="intro">
<ol class="hp-breadcrumbs">
<li><a href=
"https://web.archive.org/web/20130130211140/https://developer.palm.com/content/home.html"
target="_top" onfocus="blurLink(this);">Home</a></li>
<li><a href=
"https://web.archive.org/web/20130130211140/https://developer.palm.com/content/resources.html"
target="_top" onfocus="blurLink(this);">Resources</a></li>
<li class="ctx-last">Developing with the Eclipse IDE</li>
</ol>
<h1 class="page-title">Developing with the Eclipse IDE</h1>
<ul class="inline-icon-list">
<li><a onclick="window.print(); return false;" href="javascript:%20void(0);"
class="icon-print">Print</a></li>
<li><a href=
"https://web.archive.org/web/20130130211140/https://developer.palm.com/content/resources/develop/sdk_pdk_download.html"
target="_top" class="icon-mail addthis_button_email at300b" title=
"Email"><span class="at16nc at300bs at15nc at15t_email at16t_email"><span class=
"at_a11y">Share on email</span></span>Email</a></li>
<li class="last">
<div class="addthis_toolbox addthis_default_style">
<a class="icon-share addthis_button_compact at300m" href="#"><span class=
"at16nc at300bs at15nc at15t_compact at16t_compact"><span class=
"at_a11y">More Sharing Services</span></span>Share</a>
<div class="atclear"></div>
</div>
</li>
</ul>
</div>
<div id="content" class="col-content">
<div class="default-content article-content">
<a id="c19192" name="c19192"></a>
<div class="csc-textpic-text">
<h2 class="intro">Developing with the Eclipse&trade; IDE</h2>
<p class="intro">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.</p>
<p class="intro">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.</p>
<p class="bodytext">This document contains the following sections:</p>
<ul class="def-list">
<li><a href=
"#InstallingEclipsewiththeSDK-InstallingEclipseandthePlugIns">Installing
Eclipse and the webOS Plug-In</a></li>
<li><a href="#InstallingEclipsewiththeSDK-InstallingAptanaPlugIn">Installing
the Aptana Plug-In</a></li>
<li><a href="#InstallingEclipsewiththeSDK-UsingEclipsewiththePlugIns">Using
Eclipse with the Plug-Ins</a></li>
<li><a href="#InstallingEclipsewiththeSDK-StayUpdated">Stay Updated</a></li>
<li><a href="#InstallingEclipsewiththeSDK-dev_mode">Enabling Developer
Mode</a></li>
</ul>
</div><a id="c19202" name="c19202"></a>
<h2>Installing Eclipse and the webOS Plug-In</h2>
<div class="csc-textpic-text">
<p class="bodytext">This section describes how to install and update
Eclipse.</p>
</div><a id="c19212" name="c19212"></a>
<div class="note notes">
<div class="inner">
<div class="content">
<h4>Note:</h4>
<p>If you are using an earlier version of Eclipse, you must upgrade to
Eclipse 3.5 at minimum to get the new plug-ins for webOS development.</p>
</div>
</div>
</div><a id="c19222" name="c19222"></a>
<h5>Install Eclipse</h5>
<div class="csc-textpic-text">
<ol>
<li>Download the latest version of Eclipse <a href=
"http://eclipse.org/downloads/" target="_blank">here</a>. 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.</li>
<li>Start Eclipse.</li>
<li>When prompted for a workspace location, accept the default (
/home/YOUR_USER_NAME/workspace )</li>
</ol>
</div><a id="c19232" name="c19232"></a>
<div class="note notes">
<div class="inner">
<div class="content">
<h4>Note:</h4>
<p>The workspace location must be an absolute path with no spaces.</p>
</div>
</div>
</div><a id="c19242" name="c19242"></a>
<h5>Find and install updates</h5>
<div class="csc-textpic-text">
<ol>
<li>Select <strong>Help &gt; Install New Software</strong>.</li>
<li>In the <strong>Available Software</strong> dialog, click
<strong>Add...</strong></li>
<li>In the <strong>Location</strong> field,
type&nbsp;http://<?php echo $_SERVER['HTTP_HOST']; ?>/EclipsePlugin/site.xml,
and then click <strong>OK.</strong> (If you are unable to connect to this
site, see the Local download instructions below.)</li>
<li>Open the new site in the list, expand <strong>Palm webOS SDK</strong>,
and the click the <strong>Palm webOS SDK</strong> check box.</li>
<li>Click <strong>Install... &nbsp; &nbsp;&nbsp;</strong> and accept the
license agreements.</li>
<li>When the <strong>Install</strong> dialog comes up, make sure Palm webOS
SDK is selected, and click <strong>Finish</strong>.</li>
<li>Restart Eclipse when prompted.</li>
</ol>
</div><a id="c19252" name="c19252"></a>
<h2>Installing the Aptana Plug-In</h2>
<div class="csc-textpic-text">
<p class="bodytext">To improve the development experience, HP recommends
installing the <a href="http://www.aptana.com/">Aptana Studio</a> plug-in. The
Aptana plug-in provides HTML, JavaScript, and CSS functionality to Eclipse.</p>
<p class="bodytext">To install Aptana after installing Eclipse, go to <a href=
"http://www.aptana.com/" target="_blank">www.aptana.com</a> and Click on the
"Download Aptana Studio 3" link. On the "Download" page, select "Eclipse
Plug-in Version" and then follow the instructions given.<a name=
"InstallingEclipsewiththeSDK-UsingEclipsewiththePlugIns" title=
"InstallingEclipsewiththeSDK-UsingEclipsewiththePlugIns" id=
"InstallingEclipsewiththeSDK-UsingEclipsewiththePlugIns"></a></p>
</div><a id="c19262" name="c19262"></a>
<h2>Using Eclipse with the Plug-Ins</h2>
<div class="csc-textpic-text">
<p class="bodytext">This section describes how to run Eclipse and use the debug
launch configuration.</p>
</div><a id="c19272" name="c19272"></a>
<h3>Starting Eclipse</h3>
<div class="csc-textpic-text">
<p class="bodytext">Follow these instructions to start Eclipse:</p>
<ul>
<li>Linux: At the command prompt, type eclipse</li>
<li>Mac: In the Eclipse folder (inside the Applications folder), double-click
<strong>Eclipse</strong></li>
<li>Windows: Find and open eclipse.exe (its location depends on where you
installed Eclipse)</li>
</ul>
</div><a id="c19282" name="c19282"></a>
<h3>Selecting the webOS Perspective</h3>
<div class="csc-textpic-text">
<p class="bodytext">Eclipse has several perspectives, or views, from which to
choose. You want to work in the webOS perspective.</p>
</div><a id="c19292" name="c19292"></a>
<h5>Select the perspective</h5>
<div class="csc-textpic-text">
<ol>
<li>Select <strong>Window &gt; Open Perspective &gt; Other...</strong></li>
<li>Select <strong>webOS</strong>, and then click <strong>OK</strong></li>
</ol>
</div><a id="c19302" name="c19302"></a>
<h3>Generating a webOS Application</h3>
<div class="csc-textpic-text">
<p class="bodytext">This section includes the following procedures:</p>
<ul>
<li><a href="#InstallingEclipsewiththeSDK-CreateApp">Create a new webOS
application</a></li>
<li><a href="#InstallingEclipsewiththeSDK-AddScene">Add a scene to the
application</a></li>
<li><a href="#InstallingEclipsewiththeSDK-StartApp">Start the
application</a></li>
<li><a href="#InstallingEclipsewiththeSDK-DebugApp">Debug an
application</a></li>
</ul>
</div><a id="c19312" name="c19312"></a>
<div class="note notes">
<div class="inner">
<div class="content">
<h4>Note:</h4>
<p>You can also use the New Mojo application icon in the Workbench toolbar
to create an application or scene.</p>
</div>
</div>
</div><a id="c19322" name="c19322"></a>
<h5>Create a new webOS application</h5>
<div class="csc-textpic-text">
<ol>
<li>Select <strong>File &gt; New &gt; Basic Application</strong></li>
<li>In the <strong>Project Name</strong> field, type a name and the
following:
<ul>
<li>Title</li>
<li>Vendor</li>
<li>Id</li>
<li>Version</li>
</ul>
</li>
<li>Click <strong>Finish</strong></li>
</ol>
</div><a id="c19332" name="c19332"></a>
<h5>Add a scene to the application</h5>
<div class="csc-textpic-text">
<ol>
<li>Select <strong>File &gt; New &gt; Basic Scene</strong></li>
<li>Select the project</li>
<li>In the <strong>Name</strong> field, type the name of the scene, and then
click <strong>Finish</strong></li>
</ol>
</div><a id="c19342" name="c19342"></a>
<h5>Start the application</h5>
<div class="csc-textpic-text">
<ol>
<li>Select <strong>Run &gt; Run Configurations...</strong></li>
<li>Select <strong>Mojo Application</strong>, and then click the <strong>New
launch configuration</strong> icon.</li>
<li>In the <strong>Name</strong> field, type the name.</li>
<li>Click the <strong>Project</strong> arrow to select the project.</li>
<li>Click the <strong>Target</strong> arrow and select one of the following:
<ul>
<li><strong>Palm Emulator</strong>, if you are using the emulator.</li>
<li><strong>Palm Device</strong>, if you are using a device (ensure the
device is in Developer Mode).</li>
</ul>
</li>
<li>Click <strong>Run.</strong></li>
</ol>
</div><a id="c19352" name="c19352"></a>
<div class="note notes">
<div class="inner">
<div class="content">
<h4>Note:</h4>
<p>A launch shortcut is also available. Select the project and <strong>Run
&gt; Run As &gt; Mojo Application</strong>. If you previously created a
launch configuration, that target is used. Otherwise, a dialog box pops up
so you can select a target.</p>
</div>
</div>
</div><a id="c19362" name="c19362"></a>
<h5>Debug an application</h5>
<div class="csc-textpic-text">
<ol>
<li>Select <strong>Run &gt; Debug Configurations.</strong></li>
<li>Select <strong>Mojo Application</strong>, and then click the <strong>New
launch configuration</strong> icon.</li>
<li>In the <strong>Name</strong> field, type the name.</li>
<li>Click the <strong>Project</strong> arrow to select the project.</li>
<li>Click the <strong>Target</strong> arrow and select one of the following:
<ul>
<li><strong>Palm Emulator</strong>, if you are using the emulator.</li>
<li><strong>Palm Device</strong>, if you are using a device.</li>
</ul>
</li>
<li>In the <strong>Debug Options</strong> area, select one of the following:
<ul>
<li>
<strong>Inspectable</strong>, which makes the application's DOM
available to the Palm Inspector. This is equivalent to the following
command:<br>
<pre>
palm-launch -i &lt;appid&gt;
</pre>
</li>
<li>
<strong>Mojo debugging</strong>, which enables debug logging in the
Mojo framework. This is equivalent to the following command:<br>
<pre>
palm-launch -p "{mojoConfig: {debuggingEnabled:true}}"&lt;appid&gt;
</pre>
</li>
</ul>
</li>
<li>Click <strong>Debug.</strong></li>
</ol>
</div><a id="c19372" name="c19372"></a>
<div class="note notes">
<div class="inner">
<div class="content">
<h4>Note:</h4>
<p>A launch shortcut is also available. Select the project and <strong>Run
&gt; Debug As &gt; Mojo Application</strong>. If you previously created a
launch configuration, that target is used. Otherwise, a dialog box pops up
so you can select a target.</p>
</div>
</div>
</div><a id="c19382" name="c19382"></a>
<h2>Stay Updated</h2>
<div class="csc-textpic-text">
<p class="bodytext">When new Eclipse plug-ins are available (currently you are
notified through email), you can install them through the Eclipse Update
Manager as follows:</p>
<ol>
<li>Select <strong>Help &gt; Check for Updates</strong>.</li>
<li>Select <strong>Palm webOS SDK</strong> and click
<strong>Update...</strong></li>
<li>Click <strong>Install</strong> and accept the license agreements.</li>
<li>Restart Eclipse when prompted.</li>
</ol>
</div><a id="c19392" name="c19392"></a>
<h2>Enabling Developer Mode</h2>
<div class="csc-textpic-text">
<p class="bodytext">To install and test applications on a HP webOS device, you
need to enable Developer mode on the device.</p>
</div><a id="c19402" name="c19402"></a>
<div class="note notes">
<div class="inner">
<div class="content">
<h4>Note:</h4>
<p>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.</p>
</div>
</div>
</div><a id="c19412" name="c19412"></a>
<h3>Enable Developer mode, webOS 1.0-1.4.5</h3>
<div class="csc-textpic-text">
<ol>
<li>In Card view or in the Launcher application, type the following:
<div class="inline_code">
upupdowndownleftrightleftrightbastart
</div>
</li>
<li>Tap the resulting <strong>Developer Mode Enabler</strong> icon.</li>
<li>In the application, move the <strong>Developer Mode</strong> slider to
the <strong>On</strong> position.</li>
<li>Tap <strong>Reset the Device</strong> .<br>
When reset is complete, Developer mode is enabled.</li>
</ol>
</div><a id="c19422" name="c19422"></a>
<h3>Enable Developer mode, webOS 2.0 and 3.0</h3>
<div class="csc-textpic-text">
<ol>
<li>Go to the phone app.&nbsp;</li>
<li>On a GSM phone, press "#*DEVMODE#", followed by the call button. On a
CDMA phone or the TouchPad, 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.)</li>
<li>The Developer Mode scene will be displayed.</li>
<li>Select "On". You will be prompted to re-boot the device.</li>
</ol>
<p class="bodytext">Note that the DEVMODE code is only for unactivated devices.
It provides a way of bypassing activation and first use, and putting the device
into developer mode at the same time.</p>
<p class="bodytext">If you are using an activated device, from card view (that
is, no apps active), type the following (from the TouchPad, click in the Just
Type area to bring up the virtual keyboard):</p>
<p class="bodytext">&nbsp;</p>
<pre>
upupdowndownleftrightleftrightbastart
</pre>
<p class="bodytext">&nbsp;</p>
<p class="bodytext">Alternatively, you can use:</p>
<p class="bodytext">&nbsp;</p>
<pre>
webos20090606
</pre>
<p class="bodytext">&nbsp;</p>
<p class="bodytext">The "Developer Mode" app will come up. Toggle Developer
Mode to "On". The app will dim for a moment, and then Developer Mode will be
set.</p>
</div>
</div>
</div>
<!-- Actual Content Ends Here -->
<!-- Content Nav Starts Here -->
<div class="col-aside">
<div class="sidebox">
<h3>Contents</h3>
<ol class="article-nav">
<li class="current last">
<a href=
"/web/20131031072322/https://developer.palm.com/content/resources/develop/developing_with_the_eclipse_ide.html"
target="_top">Developing with the Eclipse IDE</a>
<ol class="level-1">
<li><a href="#c19202" target="_top">Installing Eclipse and the webOS
Plug-In</a></li>
<li><a href="#c19222" target="_top">Install Eclipse</a></li>
<li><a href="#c19242" target="_top">Find and install updates</a></li>
<li><a href="#c19252" target="_top">Installing the Aptana Plug-In</a></li>
<li><a href="#c19262" target="_top">Using Eclipse with the
Plug-Ins</a></li>
<li><a href="#c19272" target="_top">Starting Eclipse</a></li>
<li><a href="#c19282" target="_top">Selecting the webOS
Perspective</a></li>
<li><a href="#c19292" target="_top">Select the perspective</a></li>
<li><a href="#c19302" target="_top">Generating a webOS Application</a></li>
<li><a href="#c19322" target="_top">Create a new webOS application</a></li>
<li><a href="#c19332" target="_top">Add a scene to the application</a></li>
<li><a href="#c19342" target="_top">Start the application</a></li>
<li><a href="#c19362" target="_top">Debug an application</a></li>
<li><a href="#c19382" target="_top">Stay Updated</a></li>
<li><a href="#c19392" target="_top">Enabling Developer Mode</a></li>
<li><a href="#c19412" target="_top">Enable Developer mode, webOS
1.0-1.4.5</a></li>
<li class="last"><a href="#c19422" target="_top">Enable Developer mode,
webOS 2.0 and 3.0</a></li>
</ol>
</li>
</ol>
</div>
</div>
<!-- Content Nav Ends Here -->
</div>
You can’t perform that action at this time.