

Use APK Splits or NDK filters when packaging native libraries with your Android apps FontsĪnother common trend I observed is that a lot of developers are including fonts in their assets folder. (Side note - have you heard of Room from the Android Architecture Components?) You can also do APK splits on the different density devices, but maintaining different versions of your app can get quite tricky.
#Something like ianalyzer for android download#
This allows you to release multiple different versions of your app to users that have different architecture device (ie x86 or armv7) so that users don’t have to download a whole bunch of libraries they will never need. If you really need to include a native library - then please, please, please make sure you are using APK splits or use NDK filters. Before deciding to bring a library into your project, you should look into how big the library is and what it needs to include in order to run.Ī few apps that I looked into have their libs folder, filled with libraries for different flavour devices - for example, they are including all the different device architecture flavours of librealm-jni.so. VectorDrawables are supported from Android API level 7+.ĭevelopers love using libraries - hey so do I! But let us have a quick chat about using libraries. Use VectorDrawables (SVGs) instead of PNGs where possible (for all icons etc).Don’t repeat the image in different folders if it is a large image - look at using either the highest dpi folder or look into -nodpi or -anydpi and place the image only once in that folder (then load the image using an Image Loader like Glide to make sure it can handle the size in the view).For instance, use a JPG instead of a PNG, use WEBP instead of JPG if possible. Compress all your images! Please, for the sake of my sanity (and your user’s data), compress that 8MB background image.Take a look at something like Cloudinary for image resizing and hosting.) (Also - only download the size that you need. Store images on a server - compress them, and download and cache them when they are required. For instance, this app in question above had about 20 different images that related to different products that I’m 100% sure most of the users won’t ever see. Don’t package images that aren’t important to every single user of the application.Here are some tips for reducing your image sizes/usages: This took up 80% of the size of their application. We know our apps are too big, but how do we go about finding this information and improving our apps?Īnother app that I examined, had included possibly every single image of their different products that they sold inside their app. Okay, so I’ve hopefully gotten your attention. The largest app on the store had 18.8MB of images and 14MB of native libraries packaged inside. The average download size of the Top(*) South African Android app is ~15.3MB - with the largest size sitting at ~ 42MB. This blog post aims to show you how easy it is to look into your app and see what the biggest culprit of eating data in your app is. I took a look at some of the Top(*) South African Android apps from the Google Play Store and found some interesting information. Whilst analyzing these APK files, I’ve noticed some common trends/mistakes that developers make. Looking into these different APKs, I’ve come across some interesting files, from test data to iOS image files, I’ve seen it all. Whenever I see this, if I have a bit of time, I like to dive into looking at what is bloating the APK. I cringe when I go to download a basic application (most of these apps are really simple) and the download size is over 40MB. Then it comes down to creating your ImageAnalysis class.After looking around at a few Android applications, I realised that there are many developers who don’t know about a great tool in Android Studio - the Android APK Analyzer. Typealias TextDetectionsResultListener = (textDetection: TextDetection) -> Unit Or create multiple type aliases like typealias FaceDetectionsResultListener = (faceDetection: FaceDetection) -> Unit So you can add results of multiple detections inside. You can execute all your analysis in one.įirst define a typealias for what you want to return: typealias DetectionsResultListener = (detection: Detection) -> Unit You don't have to use multiple image analysers for multiple tasks.
