Skip to content

Eclipse [DEPRECATED]

Joe Bowbeer edited this page Dec 2, 2015 · 1 revision

DEPRECATED : Please use Android Studio instead of Eclipse!

If you're not convinced why, please read this.


Android development with Eclipse

You will need Eclipse 3.7 or later, as well as the Android SDK (Version 10 or later) and ADT (Version 15 or later), properly installed and configured. Earlier versions of Eclipse don't always seem to get along with the Android development tools.

In order to set up Pd for Android, open a shell, go to the directory where you want to put your Android projects (stay away from any workspace directories of Eclipse), and perform the following steps:

    git clone git://github.com/libpd/pd-for-android.git
    cd pd-for-android
    git submodule init
    git submodule update

After cloning the repositories, import the desired projects into Eclipse by choosing Import under File, then choose Existing Projects into Workspace under General. (Do not use the New Project menu item.) Under Select root directory, choose your pd-for-android directory, the click on Finish.

You may see some bogus error messages. In that case, simply select Clean under Project, then select Clean all projects. Eclipse will automatically rebuild everything, and the error messages should go away. Very rarely, errors will remain after cleaning and rebuilding. If that happens, just clean and rebuild again.

When starting a new Android project with libpd, you need to add PdCore as an Android library. Just right-click on your project and select Properties, then Android. You should see a box labeled Library on the right, and that’s where you add a reference to PdCore. Then you click on Apply and everything should work as expected.

Random aside: Don't get confused by the fact that Eclipse/ADT offers three ways of linking projects, two of which are irrelevant. You can link projects using the Java build path, Android libraries, and project references. Don't try to add Android projects to the Java build path; that'll put your workspace in a weird inconsistent state where you don't see errors in Eclipse but the ADT will fail to build executables. Don't try project references, either. The only links that make sense here are Android library references.

Another random aside: I experimented with builders for native components in Eclipse, and the results have been disappointing. So, the recommended way to build the native components of pd-for-android is make. Projects with native components will have a makefile in their root directory. (Make sure to refresh your projects in Eclipse after building native libraries.) Note: The git repositories contain native binaries, and so you only need to run make if you change the native components.