Developing with NetBeans
Modules
Instructions
The following was modified but originally taken from here:
- from the command line, start an android project
- 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)
- set the folder location and project name, and point the Build Script to the ant build.xml file
- set the Build Project to “debug” (see link above for details)
- the Source Package folders should only have the res and src directories
- set your JDK accordingly, and set the encoding to UTF-8
- in your Java Sources Classpath, add the jar file from <your android sdk dir>/platforms/<your target platform>/android.jar
- Project Output directory should be set to “bin”
- your project will now open in NetBeans (but it won't work correctly yet: package R does not exist)
- (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
- edit the ide-actions:
<ide-actions> <action name="build"> <target>debug</target> </action> </ide-actions>
- edit context-menu:
<context-menu> <ide-action name="build" /> </context-menu>
- save the file and click Build (you should now get R.java within the gen directory)
- - figure out how to get NetBeans to stop complaining about R.java without adding an import for it (the build works anyway)