I’m trying to create an android shared library for use in Unity3D.
I have it building in Android Studio with the NDK and I can get Unity to use it deploying to an emulator and device
but I’m not having any success at getting JUCE to run.
i’m not clear how I should initialiseJUCE, or interact with the deviceManager etc
#include "jni.h"
#include "shalib.h" // just has #include "../JuceLibraryCode/JuceHeader.h"
extern "C" JNIEXPORT const char* JNICALL
Java_com_example_droidtest(
JNIEnv* env,
jobject /* this */) {
//Thread::initialiseJUCE(env, whatgoeshere?); // this crashes the app
AudioFormatManager formatManager;
AudioDeviceManager deviceManager;
formatManager.registerBasicFormats();
//deviceManager.initialiseWithDefaultDevices(0, 2);// this crashes the app
// returns right at the end if the app is still alive!!
std::string hello = "This *is* the string you are looking for";
return hello.c_str();
}
