Update: Using libpd with Android Studio without the NDK

Android Studio and LibPD

Starting a new Android Project using PureData and libpd I wrote that journal entry: Using libpd with Android Studio. Because libpd was fitted for Eclipse it dows not work out-of-the-box with Android Studio and I tried to describe a solution how to get it work. A huge drawback of my solution was, that you have to compile the PD Files with the NDK before you can use them in Android.

Update: Solution without using the NDK

According to a new answer at Stackoverflow there is a easier solution to get Android Studio working with libpd. We have to set up the project as usual. You can find more details while taking a look into my older article. Until Step 3 nothing got changed.

  1. Import the PDCore and AndroidMidi folder as Module into your Android Studio Project

  2. Set up the module :AndroidMidi as dependency for :PDCore  and :PDCore as dependency to your app (core) module.

  3. Adjust the build.gradle of the :PDCore and :AndroidMidi modules. Update the buildToolsVersion and to the newest version.

  4. Instead of compiling our project with the NDK, we have to add "jniLibs.srcDirs = ['src', 'libs']" to the PdCore build.gradle file.

Test and Run

Like with the first version of this guide, the app should be running now and you should be able to generate some dynamic sound on your phone.

Update: Sample Project

I created a sample project for sharing. You can find all relevant information about it here: Sample Project for using libpd with Android Studio