The app includes a 16x13 matrix taking up most of the screen.
When you drag your finger across the matrix, every column will have one row selected based on your finger position.
So far so good:
created a Component that draws the matrix grid
have 16 child components to indicate the selection
I’m using overrides of mouseDown, mouseDrag, mouseUp to track the position of the mouse / finger and update the selection based on the current mouse event position.
However, I’m experiencing really laggy mouse handling in Juce, as I move my finger across the screen faster it’s pretty common not one mouse event is sent for full columns being 50-100px wide.
Somehow mouse events are slow and too sparse with large intervals between them.
I’m running this on a brand new Nothing Phone with 8 gigs of ram and a modern Snapdragon processor.
I did the same app natively on iOS and didn’t even have to go into any type of optimization, it was just working fine even on 8 years old devices.
Touch events were extremely reliable and precise with new events coming in on 1-2 pixel movement changes.
Do you have any tips on optimizing this, I’m running out of ideas on what to try and considering getting rid of JUCE completely and go with Flutter. The interaction and responsiveness is just that awful.
Btw, having no multi touch support is also an issue, but for now I can live with that.
No, that’s not normal. You should be able to get such an app to work perfectly using JUCE, even on relatively old Android devices.
Are you using openGL? If not, try creating an OpenGLContext and attach it to the MainWindow (but do this just for your Android build, on iOS performance is normally better without), and test using a release build.
Other than that, without seeing some code people won’t be able to help much, I’m afraid.
Also, what do you mean that there is no multi touch support?
This made a world of a difference, now it’s really smooth. Thanks for the help and the prompt response.
For completeness and future reference for others I had to add the juce_opengl module in Projucer.