Tutorials webOS Loading Existing Apps Into An Eclipse Project
From WebOS Internals
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
- Start Eclipse
- Right click anywhere in the project explorer and select New|Project
- In the Select a Wizard, choose PalmWebOS|Mojo Application
- For the project name AND title, I recommend using the name (i.e. root directory name) of the app you are targeting
- 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:
- Close Eclipse if it is open
- Navigate to the location where Eclipse stores it's projects (on my machine it is c:\sandbox)
- In another File System window, locate the directory of the app you want to load (i.e. com.palm.app.Messaging)
- 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)
- Open the .project file in the new Eclipse project directory. You will see a line that looks like this:
Change it to this:
Loading and verifying the project
- Start Eclipse.
- There will be a message about the file system being out of sync. Select File|Refresh.
- Edit the appinfo.json file. You must add the vendor and version items.
- Change the app name (example: com.palm.app.Messaging to com.palm.app.Messaging2)
- 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