Since I’m only really using openGL, poco, ofSoundStream (no 3d, video, cario, assimp, etc), is there any way to reduce the file size of OF for android? Right now since It’s compiling for 3 architectures (arm, arm7, arm node) the file size after being uncompressed is around 26mb. From my understanding, that’s pretty big to most people.
actually, most of the libraries won’t get linked at all, there’s no cairo, assimp won’t get linked unless you add the addon to your project… i tried to make it smaller but that’s the smallest it can get.
Actually if you are doing real time sound probably is smart to only give support for arm7 and neon, will avoid you lots of headaches with support, there’s lots of shity android phones out there which can’t support something like rt audio and the best way to differentiate them is because they usually have arm6 or even 5.
So when making the release package, just remove the arm folder in libs and edit Android.mk and remove armeabi.
That will make the app smaller.
Also if you are going to work with soundstream there’s lot’s of fixes in the develop branch. And be careful with the input: some phones (mostly samsung) will crash if you try to open it as stereo, so when configuring the soundStream use always mono for the input and then convert it to stereo by duplicating the channel if you need to.
Thanks for the great advice (as always) Arturo. I’m using ofxPD and real-time synthesis - no input, so this advice is perfect. I’ll try removing arm folder/lib and that should help a lot. I’ll check out the new ofSoundStream work as well.
I took the advice of releasing for armv7 only, but people are complaining that the size is still too big. It’s 17mb when unpacked. This especially a problem for Android 2.2 users since ndk code can’t be put on the SD card. Do we know the breakdown of what libs are contributing to the file size the most? Would it be possible to do 3 builds, armv7, armv6, neon and then post as multiple apks? I guess size won’t be as much an issue once people are off of Android 2.2
poco freetype and freeimage, the rest of the libraries are not used in android.
If you are not using images you can get rid of freeimage, you’ll need to comment out some lines in ofAppRunner that reference it.
For freetype you shouldn’t need to do anything, actually if you are not using fonts it shouldn’t be included in the final binaries.
Poco can be more difficult to get rid of since it’s used now in several places.
You can also try to not include ofMain.h but only the headers that you actually use. But not sure if that’ll make any difference.
Thanks Arturo (very quick response!).
I’ll look into these. I guess it’s really more of an issue with Android 2.2 and the whole not being able to move things off the internal memory when using NDK. I may just wait till ice cream sandwich comes out (since it’s so close) and see if the number of Android 2.2 users drops a lot. It’s hard to not pay attention to them when they make up 25%+ of the users.