Getting Started with JavaROSA Development

The repository is publicly accessible with read-only permissions. For write permissions, please contact a member of the javarosa-developers community.

Setting Up the Development Environment

Several of these installs are not small, make sure you are on a stable connection when you try to download them.

  1. Install the Java Standard Edition Development Kit (JDK) 5.0
  2. Install the Sun Java Wireless Toolkit for CLDC v 2.5.2. It is recommended to install to the default location of C:\WTK2.5.2 to avoid having to re-map libraries locations.
  3. Install the Eclipse IDE for Java Developers
  4. Install EclipseME 1.7, the Eclipse J2ME plugin,
  5. Install Subclipse v 1.0.6, the Eclipse Subversion plugin
  6. Install J2ME-Polish v 2.0.4.
    1. You should only need to set the WTK directory during the install process (what you installed in step 2.)
  7. Install any vendor-specific SDKs/Wireless Toolkits you may be interested in, and repeat the 'Import Device Profiles' part of the 'Setup J2ME in Eclipse' step below.
  8. Make sure your default JRE in Java->Install JREs points to a JDK not a JRE.

Setup J2ME in Eclipse

  1. After Installing, in Eclipse, go to Window -> Preferences.
  2. Select the J2ME node
  3. Import device profiles
  4. Navigate to the install directory of the Java wireless toolkit
  5. Select refresh
  6. Select DefaultColorPhone (or another phone of choice)

Getting the Code

  1. If you are creating a new workspace, follow-step "setup J2ME in Eclipse" from above.
  2. Download this file (also attached to this page at the bottom), which will be used by Eclipse.
  3. Open Eclipse.
  4. Go to File -> Import.
  5. Under Team, select "Team Project Set". Click Next.
  6. Locate the Team Project File that you saved in step 1.
  7. Click Finish.
  8. If the import fails, please follow the 'Alternate Checkout' instructions section below.

Building the Code

  1. The main project to use is org.javarosa.demo. It has dependencies to the other projects, enumerated both in its .classpath file, and its build.xml file.
  2. Open the org.javarosa.demo project.
  3. Open the build.properties file.
    1. Set the polish.home variable to the location of J2ME-Polish on your system.
    2. Set the wtk.home variable to the location of the Sun Wireless Toolkit on your system. Repeat for any vendor-specific toolkits.
    3. Set the app.class variable to the name of the MIDlet you wish to run.
  4. Right click on the build.xml file and select Run As -> Ant Build.

Alternate Checkout

If you continue to have problems with the Team Project file, follow the directions below to get a checkout of the code.

  1. In Eclipse, open the "SVN Repository Exploring" Perspective. This can be found in Window->Open Perspective->Other...
  2. Right click, and select "New->Repository Location"
  3. Enter the URL: http://code.dimagi.com/svn/JavaRosa
  4. Expand the node for the repository location
  5. Expand the node for 'branches'
  6. Expand the node for 'dev'
  7. Select all of the "org.javarosa.*" projects by clicking on the first node (org.javarosa.action) and then shift-clicking the bottom node (org.javarosa.xform)
  8. Right click on the selection and click "Checkout"
  9. On the next screen, hit Finish.

Troubleshooting Dev Environment

Troubleshooting the Development Environment

Set up Debugging

Debugging Setup

Now What?

Attachments