android Memory ,vector images - android

I have been making a project in android and it has almost 10 classes as activities or fragments . the sizeof the apk is ~5mb , how can I reduce that . Also , I considered using android provided icons instead of png images but it looks like I would save at most 100 Kb. I don't think that would make much of a difference or would it ?

Related

How do i find what is increasing the size of my andorid so file

Hey i'm using a native library for my android application and it compiles to an so file of size 2.5 mb. i tried different ways to reduce the size but did not get a solution. i was wondering if i could find out what exactly is causing the size issue by going through the so file is this possible.
When you are using AndroidStudio you can just open the apk in it. It will you the content of it and what size the diffrent components have.
You can analyze APK with APK Analyzer by drag APK file into Android Studio. It will show detail of classes and resources size.
https://developer.android.com/studio/build/apk-analyzer
https://github.com/google/bloaty can show you a breakdown of where the space is being spent. It can also diff two binaries to show you the changes, which is really helpful when trying to figure out what effect any flags you tweak might be having.

How to handle large number of vector drawables in Android

I am building an Android app in which I have many vector drawble in XML format (around 10000 files). Currently, I put them in the resource folder and it takes very long time to build the app.
Is there any better way to handle this?
Have you tried moving them into a separate module? By the way, maybe you can try putting them on the server and downloading them just on demand, and just having the really main ones in your APK.

Reading ICO file in android along with all sub-images

I have found Is there a way to decode a .ICO file to a resolution bigger than 16x16? from 2 years ago and the best suggestion was to use image4j. Unfortunately it does not work under android in particular (also), because the classes "IndexColorModel", "BufferedImage" and "WritableRaster" are not available.
While working around "BufferedImage" by replacing it with "Bitmap" may perhaps work and not using "WritableRaster", but instead setting individual (or a group of) pixels using setPixel may work as well, I cannot manage to replace "IndexColorModel", because I cannot wrap my head around it.
I am currently downloading a favicon from a website, which stores usually more than one image inside of it. The images are of different size. I read up on the structure of ICO files and analyzed image4j as much as I could. Yet I have troubles refactoring the various classes to not use AWT.
BitmapFactory is able to load ICO files; unfortunately it only loads the first image (this is my guess at least) and thus does not let me decide which image to load (let alone load them all and let me chose).
Does anyone know if anything changed from 2 years ago and/or would anyone be willing to help me refactor e.g. BMPDecoder from image4j? Or is there perhaps a totally different, easier approach to it?
I have created a library based on image4j that will allow reading ICO files into a List of Bitmap-objects. In contrast to image4j ico4a does not use any AWT-classes, but instead only makes use of Bitmap / Bitmap.createBitmap.
See https://github.com/divStar/ico4a .
While the library's performance might not be the best as it uses a Bitmap-object's setPixel method in a loop, it gets the work done and it's good enough for me.
In comparison to image4j my library (ico4a) only decodes/reads files. While saving ICO files could be done probably relatively easy, I have not done so since I do not need it myself.
If you have further questions or issues with the library, post them on gitHub and I will see if I can help.

Android Expansion File. How can I put library in expansion file

I am working on an app where we are using lots of libraries to provide funtionalities like reading PDF,docx,ppt etc also we have a youtube player and many more other libraries.
Due to the design of our app, we are using lots of resources to design UI(resources is about 22 mb). We are using these images in layouts (which are lot if you ask).
I checked to see whether we can go down on using Background images, but more we strip them, our client asks for more features to integrate in the app which again increases the size to more then 50 MB (Google play limitation as mentioned here Google play expansion file setup link) .
I am looking for a solution where I can somehow remove the libraries while compiling the app to keep size under limit of 50 MB and put it in expansion file (I know this seems to be a problem, cuz I don't know how I will compile the app without those libraries) and load it on run time .
I am very confused here, Can some one help me here ??

Confusion on multiple design resource files in Android

I'm trying to accomplish whats written HERE on supporting multiple screen sizes, I understood that every design in the app should be in 3 sizes.
1. The designer asked the 3 sizes he should design for, he already created designs in 1 size which is 480x800.. What are the other 2?
2. My .apk file is 5 mb big with only the designs of 1 size (480x800).. So when I add the 2 other the .apk will become huge.. How do I avoid this?
Obviously you need to compress the files to a suitable size and implement the look and feel in code/xml.
Besides that if you still run out of room you could create multiple application for different devices with a whole bunch of disadvantages in terms of market presence.

Categories

Resources