Best approach for Android/iOS app with JUCE

I’m currently planning a mobile app and I’m wondering if this can be written entirely in JUCE or if it’s best practice to write native UIs with just a JUCE-based core?

Would be great to know how others have done it.

Thanks!

If your app is just a one or two screen custom GUI then doing it all with JUCE can work well.
But in general I recommend doing the majority of the UI natively and create a library with JUCE, ideally as a sub project of your native app.

2 Likes

Hi, I write all my mobile apps entirely in JUCE.

1 Like

Thanks for the answers!

@adamski: why don’t you use JUCE GUIs? Are they not as good performance-wise from your experience?

JUCE was originally designed for desktop platforms. It’s great for custom GUI’s - sliders, buttons, drawing waveforms etc. But it cannot compete with the native iOS and Android UI’s in terms of smoothness, look and feel, and user familiarity. So I now take the best of both worlds; use JUCE for what it excels at, and native API’s for the rest.

2 Likes

yeah, totally understand that. i just like to have one code base across all the desktop and mobile platforms, so I just stick to JUCE.

1 Like

I also agree with that - it does add quite a bit of overhead mixing languages and frameworks. Making use of other cross-platform frameworks like React Native or Xamarin can help with that, but IME add too much abstraction and complication on top which I’m not sure is worth it. Haven’t tried Flutter yet though and I saw they recently added support for linking C++ libraries.

The advantage of sticking to the “native” API’s is that you have access to the core functionality of the platform - no need to rely on JUCE to implement things like billing or push notifications for you. So lots more flexibility.

2 Likes

@adamski Sounds like an architecture I would like to adopt as well for mobile dev (native UI + JUCE lib). However, in the README for your audio-engine project, you mention the caveat of JUCE being linked dynamically, which doesn’t pass app store approval. Is this something you have solved since?

I think this approach of integrating with React Native is quite nice. https://youtu.be/bsy0-mHcS4Y
I would definitely try it. Just need to wait for Roli to release “react_native_bridge” module. Now I wonder if this is even going to happen or not.
I tried dart::ffi with Flutter, it’s not bad. It’s quite a bit of boilerplace code.

that’ll never happen because Roli doesn’t own JUCE anymore!

As the Producer currently does not support creation of Xcode dynamic frameworks, which are required for iOS App Store submissions, I switch the JUCE project to Static Library for iOS. However, now that we have proper CMake support, there is the possibility to use CMake to generate projects, and CMake does support creating “Cocoa Touch Framework” projects. I’m definitely going to try this soon!

2 Likes

Yes, I’d be interested to try using the techniques Tom spoke about in that talk. I abandoned using React Native and JUCE in end due to the boilerplate and the extra levels of abstraction (as well as the npm dependency mess…). Looks like Tom et al found a neat way to circumvent a lot of the boilerplate by hooking into React Native’s C++ layer.

1 Like

Hi there,

Can someone provide a simple and up-to-date example of mixing UI native elements and JUCE GUI on iOS and Android ?

I downloaded @adamski’s NativeNavigation example on github but it doesn’t work anymore.

I looked everywhere and didn’t find a step by step example of that, i don’t know where to start.
My fully JUCE app works pretty well on both Android and IOS but to improve it i need to access native features on both platforms.

For example on iOS, should i start from making my Main.storyboard in XCode and include JUCE library after or should i start from the Projucer as i’m used to and then export to Xcode(iOS) and manage (i don’t have any clue how) mix native and JUCE elements ?

Any help would be much appreciated
Thank you

Apologies, I have been meaning to make a tutorial on this subject for over a year now.

First thing to ask is: Do you want a native app with some JUCE elements? Or do you just need a native component in your JUCE app (e.g. a scrollview)?

Thank you for your reply ! I would say the second.
I’ve made a full JUCE app but at some point i would like to ask for in-app review.

Actually i want to call SKStoreReviewController.requestReview() method on iOS after a precise user action on my app.

But i don’t understand how to basically communicate between my JUCE app and the native code

Same thing on Android

See this thread Slow/jittery performance with ListBox scroll on iOS

I finally managed to do this with the help of your example and your slideshare presentation.

Thank you very much :slight_smile:

If someone is interested i can explain it step by step.

Cheers

Thank You!