How can I reduce the final app size when building with Phonegap Build ?
When building with Phonegap Build for Android all the other platform files, images, icons and splash screen files are also included in the Android .APK and vice versa for the other platforms.
I am now using the new method for generating the icons and splash screens. How can I remove the un-used files, icons, splash images etc?
I have tried .pgbomit but this does not have any effect when using the new way to generate the icons and splash screens.
I opened the APK file in googles Android Studio and the ios icons and splash screens seem to double the size of my APK.
I also tried changing the .apk to .zip, deleted the ios icons and splash screens, changed the file back to .apk but it wont install due to no signing certificate (must be removed when unziping folders).
Is there anything I can add in the config file to stop NSBasic generating the icons and splash screens for platforms I dont need ?
Pro_Certs,
I always take a few minutes to convert all the generated png files to 8bit, dithered and they still look great. By default, they’re huge 32bit png’s. It reduces the size of my res contents from about 5mb to 2mb. For each app, I keep a master set of splash and icons per platform. Then…
When deploying to iOS, I leave the Android icons and image files there but melt them all down to 1k.
I do the opposite when deploying to Android. Takes a few minutes extra initially but it makes a big difference in the deployment file size.
Yes, I used to compress all my images as much as possible but now the new method that NSBasic V8 uses takes one master image (icon and splash) and auto generates all the other required sizes which I have no control over, it saves a lot of time but it bloats out the app file size.
I may have to revert back to the original method of manually adding my own compressed images and referencing them in the config file, this way I can and reference the actual platform icons and splash I’m building for.
With the average size of apps these days, I’m not sure that saving 1 meg in the size of the executable will be noticed by anyone.
OTOH, you’re now assured that all the different sizes which will be needed are included with your project - and that new ones will be added automatically when required. Your app will look good no matter what device comes along.
Well the idea is to let V8 auto-generate the images, or use Abiro.com to generate them. Then I run a batch command in Fireworks (or use Photoshop), to compress and re-export every image in the res folder to 8bit, dithered. The whole process takes less than a minute and I knock off 3 or more mb of data.
George is right, knocking off 1mb of data is not much these days, but 3mb or more does make a bit of a difference.
Here is a great example. Here is one of my apps res folders that I just finished back in December. Reduced from a whopping 11mb down to 5bm. That’s a BIG 6mb savings in file size there. Image sizes always depend on the number of colors in an image and the bit depth.
Posted here after having replied to wrong thread: Since I stopped producing native iOS apps I always thought it could be nice to get rid of these iOS icons etc. Leaving solely the platform android in config.xml does not help. PhoneGap sets the iOS platform on Error. This issue is not really important for me. But one could think it over if every user downloading an Android apk should download an ios folder too with useless ca. 2,53 MB of png files for iOS.
I was surprised to discover that PhoneGap Build includes both platform’s assets in the executables it creates. However, I still believe that in today’s world, the extra size is not noticed by anyone. The latest data I can find on average app size is from 3 years ago, where the average iOS app was 38 megs. I’m sure it’s significantly larger now.
I might agree. My two cents worth about statistics: My AppStudio apps are between 4.1 and 7.x MB. Solely 1 is 14 MB, where the size comes from >100 mp3 files. I guess so small sizes of apps would not occur often.