Android/Eclipse
< Android
Jump to navigation
Jump to search
Using Eclipse to Develop Android[edit | edit source]
Adapted from http://source.android.com/source/using-eclipse.html
Note:
- These instructions assume that your Android source is located in ~/android-dev. If you do not have a Git repo setup there yet, see GitSetup.
- Eclipse will never 100% compile the Android repo. This is normal. Use the regular make process from the command line when you are ready to build. LifeTechRelease
Steps to setup
- You need to build Android before Eclipse will be completely happy. If you haven't built it already...
cd ~/android-dev make
Building Android will take a while. You can proceed with the rest of these instructions, but Eclipse will complain about missing dependencies until the compile is finished.
- Eclipse needs a list of directories to search for Java files. This is called the "Java Build Path" and can be set with the .classpath file.
cd ~/android-dev wget http://embedded-dev/android-dev/classpath.zip unzip classpath.zip rm classpath.zip chmod u+w .classpath
- Start Eclipse
eclipse
- If Eclipse asks you for a workspace, choose the default.
- If you have a "Welcome" screen, close it to reveal the Java perspective.
- Click File => New => Java Project.
- Call it "Android".
- Clear the checkbox next to "Use default location".
- Click "Browse".
- Browse to ~/android-dev.
- Click "Finish". This will take a little while. Don't worry.
You should end-up with the Android packages in your Package Explorer.
If there's an exclamation mark next to your project, don't worry. It'll clear up once Android finishes compiling.
The project will fail to compile. That's normal.
