Mobile navigation in full JUCE

Hi everyone,

I will work on a mobile project totally based on JUCE. I watched the great tutorial of @adamski about how to integrate JUCE into native mobile project in Swift or Kotlin.
However I would need to use only JUCE but I cannot find anything regarding the navigation like uinavigationcontroller, push or modal transition for iOS example.
Is it possible to achieve something similar with Component?

The techniques I present in that talk are quite different to how I approach the problem these days. I have been planning on creating a new tutorial on this subject.

You will not get smooth transitions, scrolling and animations using only JUCE. If you want that you should combine JUCE with native APIs. Currently I create a library project from Projucer and hook it up in an Xcode / Android Studio project.

1 Like

Thanks for the feedback @adamski can’t wait to see this!

Unfortunately I cannot use native APIs. But I think I find something. The ComponentAnimator class could do the job. I will just have to create a coordinator class that will handle navigation of pages with the use of the animateComponent function.
Kind of little of work but could do the work I guess.

It’s certainly possible to do this. I’ve seen few apps in the past that do, and also tried to achieve it myself. But IMO, if doing a pure JUCE project, I would try and avoid mimicking OS animations and choose different UI patterns that JUCE provides.

Trying to get smooth component animations is especially problematic on Android, iOS is not so bad.

Interesting feedback @adamski
What do you mean by:

if doing a pure JUCE project, I would try and avoid mimicking OS animations and choose different UI patterns that JUCE provides

Just to be sure I’m not missing a UI pattern from JUCE. From what I’ve seen it’s basically a change of the component visibility (with addAndMakeVisible) no?

@adamski I just see this project you made what’s your feedback on it? Did you used in production code?
One of my potential client would like only JUCE C++ code for iOS/Android platform so I cannot use your first suggesting about doing it in native.

@DEADBEEF This FR might be of interest. Please vote if that’s the case!

1 Like

Thanks for the link @jrlanglois, funny that I just saw it few minutes ago and already voted for it :slight_smile:

Also I guess you’re working on mobile projects too. Did you manage to handle it with JUCE only? How do you handle the navigation / transition? :thinking:

1 Like

No I didn’t ever use it in a production app. I abandoned it as it was too clunky, not smooth enough. You can try it for yourself although its quite a few years old now (JUCE 3.1!) and was based one another developers code (@haydxn).

My honest opinion is that trying to replicate smooth native gesture animations, especially on Android, is a dead end with a pure JUCE app.

Thanks for the feedback @adamski.
I only tested it on iOS and it wasn’t really smooth but still "acceptable. Now with what you just said, I’m afraid of what I will see on Android…

Maybe when the client will see a demo of the navigation animation he will change his mind regarding doing a full JUCE based mobile application.

Hi everyone, sorry to revive this old thread but it still seems quite relevant.

@adamwilson I was wondering if you could tell a bit more about your experience trying to build the entire GUI using JUCE and specifically trying to reproduce gesture animations? How far did you get before deciding to use native APIs instead? What were the actual problems?

I ask because until now I’ve been trying to just use JUCE and work around the limitations. For example, I am managing the swiping/scrolling myself instead of having the viewPort do so and I have modified the JUCE codebase in a few places to get the comboBox and treeView to react to mouse events as I needed. It seems to me that this has been quite less work than would have been needed to use native APIs.

Until now I’m happy with the results. As far as I can tell, swiping pages with GUI elements is working smoothly, even on Android. So I wonder if there are aspects I have missed or if I will run into problems later on once things get more complex and will need to backtrack as you did? (Or perhaps my standards are just too low :rofl:)

Your talk is from 2015 so I wonder how much things have changed since then (for example, on Android I am testing on a Galaxy A5 from 2017, which by today’s standards is already quite old). Perhaps nowdays doing the entire GUI using JUCE is a viable alternative?

If anyone else (@DEADBEEF ?) would like to share their experiences that would be great!

I decided to not use Juce for Mobile app UI rendering. Juce is great for doing audio stuff but I felt more productive using it for mobile. Also thanks to UI declarative paradigms on mobile it’s even faster to do the UI on iOS and Android rather than using JUCE. If you architecture well your app you can almost have only UI on native platform and share logic code to them by creating custom frameworks.
But I the end it’s all about how you feel regarding a technology and your team.