Tutorials webOS Loading Existing Apps Into An Eclipse Project

From WebOS Internals
Revision as of 20:35, 1 August 2009 by Sottey (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This guide assumes you have a rooted Pre, with SFTP access or a working emulator. If you don't, please follow the other guides on this wiki first. This guide also assumes that you have Eclipse installed, along with the Mojo Plugin.


Loading an existing Application as a project in Eclipse:

The simplest way to look through and app (which is the fastest way to learn to develop for a platform) is to load up a compilable project and be able to run it, poke at it, change it and see how it works. Doing this from the filesystem is cumbersome, as you have to make your changes, recompile the ipk, deploy to the device or emulator and run it.

To simplify/streamline this process, it is best to create a new project for the existing applitation, migrate the existing application and then be able to work with it as if it were your own project, debugging, etc.

The process to create an Eclipse project out of an existing app is very, very simple. In this example, we will use the com.palm/app.Messaging app.

Creating the project

  1. Start Eclipse
  2. Right click anywhere in the project explorer and select New|Project
  3. In the Select a Wizard, choose PalmWebOS|Mojo Application
  4. For the project name AND title, I recommend using the name (i.e. root directory name) of the app you are targeting
  5. Leave the rest of the items alone for now and click Finish

Adding the existing application

Now you should have the default project that Eclipse creates for a mojo app. Now we just need to copy in the existing app:

  1. Close Eclipse if it is open
  2. Navigate to the location where Eclipse stores it's projects (on my machine it is c:\sandbox)
  3. In another File System window, locate the directory of the app you want to load (i.e. com.palm.app.Messaging)
  4. In the Messaging directory (where you have the source code installed, for me: C:\Users\sottey\Desktop\webOS\usr\palm\applications\com.palm.app.messaging), select everything and copy to the new eclipse project directory (i.e. c:\sandbox\com.palm.app.messaging)
  5. Open the .project file in the new Eclipse project directory. You will see a line that looks like this:

   <nature>com.palm.pdt.nature</nature>

Change it to this:

   <nature>com.palm.luna.sdk.lunaNature</nature>

Loading and verifying the project

  1. Start Eclipse.
  2. There will be a message about the file system being out of sync. Select File|Refresh.
  3. Edit the appinfo.json file. You must add the vendor and version items.
  4. Change the app name (example: com.palm.app.Messaging to com.palm.app.Messaging2)
  5. You also must change the appinfo.json for every localized version. These are found in the resources node of the Eclipse project.

Voila! you have the project loaded, AND it is recognized as a Palm project. you can then create a new Run Configuration (Run|Run Configurations...) for that project and you are all set

To Do List:

  • Add links to the Eclipse and Eclipse Plugin Installs
  • Add screenshots