Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt on android, reducing the binary size

Am using Qt to build app on android, Qt Quick mainly its really nice, but my main problem is the start up size is around 27 MB which is huge for initial size.. is there a way to reduce this size ?

like image 601
Creative Coder Avatar asked Sep 23 '14 19:09

Creative Coder


2 Answers

If you you don't want to use Ministro Service, you should include only the necessary Qt modules. Omitting the unnecessary modules will reduce the APK size significantly. This is a quote from BogDan Vatra the man who ported Qt to Android :

Qt files can go slightly over 40Mb/platform if you are going to use all of Qt modules. Of course your application doesnt need all the modules, so, if your application uses only Qt Quick Controls + Qt SVG + Qt Multimedia + Qt Sensors + Qt XML modules, Qt files (libs + plugins + additional files) are ~20Mb/platform and your APK will be ~10Mb.

You can see Choosing the right deploying system

like image 166
Nejat Avatar answered Sep 18 '22 14:09

Nejat


Yes. You are most likely bundling Qt itself with your app. That's the default setting in Qt Creator. Go into your project settings (the Projects button to the left of the UI) and under Android/Run/Make Install, click on the Details button. There you can switch the Qt Deployment from Bundle to use Ministro Service.

This way your apk will be a lot smaller, but you need to install the Ministro Service from Play Store. Ministro contains Qt libraries that other apps can use.

Hope that helps...

like image 32
johnz Avatar answered Sep 16 '22 14:09

johnz