I am building a prototype app with OpenCV. The app currently does not do anything but its apk file size is 6MB. The size is 10 times of normal app size. Is there any way to reduce this size?
Update: I found out that as long as I use android native camera and interface with OpenCV in JNI/C++, the file size can be dependent on the methods you are using in the library. Current my test app with simple filter has size of 700K.
You can unzip your .apk file and find two versions of
opencv_java.sounder thelibfolder. Each of them is about 5.6Mb.Actually
opencv_java.sois the OpenCV library. And it is hard task to reduce its size even to 4Mb. But you can easily remove second copy ofopencv_java.sofrom your .apk if you don’t need to support old ARMv5 and ARMv6 devices. (The simplest way to build your app without armeabi OpenCV libraries is removing alllibs/armeabifolders from OpenCV package and rebuilding your application.)