Table of Contents

Developing with NetBeans

Modules

Instructions

The following was modified but originally taken from here:

  1. from the command line, start an android project
  2. in NetBeans, start a “Java Free-Form Project” (if you already have NetBeans stuff in the project, delete the nbproject folder and any other NetBeans files)
  3. set the folder location and project name, and point the Build Script to the ant build.xml file
  4. set the Build Project to “debug” (see link above for details)
  5. the Source Package folders should only have the res and src directories
  6. set your JDK accordingly, and set the encoding to UTF-8
  7. in your Java Sources Classpath, add the jar file from <your android sdk dir>/platforms/<your target platform>/android.jar
  8. Project Output directory should be set to “bin”
  9. your project will now open in NetBeans (but it won't work correctly yet: package R does not exist)
  10. (if you did the steps exactly as above, these items should already be done for you) go to the Files tab, and edit nbproject/project.xml as follows
    1. edit the ide-actions:
                  <ide-actions>
                      <action name="build">
                          <target>debug</target>
                      </action>
                  </ide-actions>
    2. edit context-menu:
                      <context-menu>
                          <ide-action name="build" />
                      </context-menu>
  11. save the file and click Build (you should now get R.java within the gen directory)
  12. FIXME - figure out how to get NetBeans to stop complaining about R.java without adding an import for it (the build works anyway)