Android/Eclipse

From VentureResearchWiki
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

  1. 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.

  1. 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
  1. Start Eclipse
eclipse
  1. If Eclipse asks you for a workspace, choose the default.
  2. If you have a "Welcome" screen, close it to reveal the Java perspective.
  3. Click File => New => Java Project.
  4. Call it "Android".
  5. Clear the checkbox next to "Use default location".
  6. Click "Browse".
  7. Browse to ~/android-dev.
  8. 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.

Eclipse 1.png