Compiling processing input tutorial

Hi All!,
Has anybody successfully compiled and run JUCE processing input tutorial for Android?
I have tried several combinations (including using either clang or gcc) and I can’t compile it.
Previous tutorials in the list were OK (except for the play a file tutorial, there was a problem with the file chooser).
Using GCC I get a weird error: "Error: bad instruction 'int $3’
Using clang I get errors about nullptr definition.

How are you using GCC? You should just open your project with Android Studio and build. Android Studio will always use clang by default.

Did you update your ndk bundle to the latest? There were some bugs in the gcc compiler a while back which triggered exactly that error when doing certain comparisons between floating point numbers.

Hi Fabian,
To use GCC you can set it at NDK Toolchain property of the Android Exporter in Projucer (you can choose between GCC or clang), or you can change it directly in the corresponding gradle file.

To make more tests I tried Android Studio 3 using the last Release Candidate for NDK 16.0.4293906 rc1 and Oreo (Android 26).

Finally it’s working by setting the target SDK version to 26, the same as the compileSdkVersion by setting Minimum SDK version in Projucer to 26.
In my opinion Minimum SDK version is not appropriate, since it’s usual to have a lesser minimum SDK version that the one you use for compiling.

That’s strange - we just don’t have this problem. I regularly compile the JUCE demo for minimum SDK target 10.

Hi Fabian,
I updated to Android Studio 3 RC1 and it’s working now for API 23, but no sound is generated.
The setup I use for testing is an i-Rig (the original one, not the second version) featuring one input (usually for a guitar) and a headphones output attached to the headset input of the testing device. There is another android device playing music in the i-Rig input and the headphones are attached. The setup works because I’ve tested it with the recorder and it records what’s played in the other device, and I can here it in the headphones. Maybe it’s not selecting the right input?
Please, find a link to the generated APK I used for testing below:


Best,
Víctor

Hmmm I wouldn’t recommend updating to AS 3 RC1 just yet. But if it works for you…

Can you try the JuceDemo in JUCE/examples/Demo? Just import the Android folder at JUCE/examples/Demo/Builds/Android after launching Android Studio:

Then hit the run icon. In the demo, you can go to the “Audio: Settings” demo to select and test your audio devices. Test the other audio demos for midi etc.

Thanks for the input Fabian.
I had no problem during compilation, except those small changes required to compile in last SDK versions.
Please, find below some feedback after testing the demo:

  • In Dialog Boxes, both Load File Browsers demos are not working.
  • Web Browser it’s not working.
  • Recording demo it’s not working for all devices, only for those having a folder called “Documents” before launching the App. My guess is that there is a problem with the way files are managed. When calling File::getSpecialLocation (File::userDocumentsDirectory) it will return ‘Documents’. Unfortunately, that folder it’s not always available, even if API version >=19.
  • In the lists in general there is something missing: drag to scroll to be more consistent with Android.

Testing devices: Xiaomi Redmi 3 running Lollipop 5.1, Xiaomi Mi Max running Marshmallow and Google Pixel C running Oreo.

Tested again the Processing Input tutorial compiling with the same configuration as the Juce Demo and it works!

Best,
Víctor

Thank you for your feedback.

Yes, we know about this. File browsers are not supported at all on mobile (iOS and Android) at the moment. We have a fix for this in the pipeline.

This is also a known issue. Not sure when we will get round to implementing this though.

We wanted to keep the demo at SDK version 10 by default - and you are right. For these SDK versions the recording demo will not work. If you change the minimum sdk version in the Projucer to something newer and select read/write storage permission then the recording demos will work as expected.

This has already been fixed on develop.

Thanks Fabian.
The demo already works targeting and compiling API 10 in OREO, at least in my Google Pixel.