Android Release Build Optimisation (reduce APK size, ram and cpu usage)

Hello there.

Can you please give some advice to optimize an android application? I want to reduce the apk size, ram and cpu usage. I wonder if there’s a way to reduce the juce library size, or configurations to do from Android Studio?

Do you build for any other platforms or only Android? I find it’s easiest to build for at least one Desktop platform in addition to the mobile platform you are targeting. For iOS, also build for macOS, and for Android any Desktop platform is suitable, though Linux is ideal.

If you don’t use all the JUCE modules you can set things up to include only the JUCE modules you actually do use. You could also try CMAKE_BUILD_TYPE=MinSizeRel and see if your APK is smaller.

Otherwise RAM and CPU usage optimizations will probably track equally on any platform, so optimization should probably be done on a Desktop platform where it is easier to do the work. You can set up profiling tools to find your hotspots and bottlenecks and go from there.


Thank you very much :pray:
I build for windows and android platforms, but in seperate projects(there are some differences between them). I’m not much familiar with android studio, so I find useful to use Visual Studio tools to profile the application besides Android studio.
I’ve checked the project if there is any juce libraries which are unnecessary. Then configured gradle files to remove x86 x86_64 libraries from APK.