Sowndarya
Sowndarya

Reputation: 59

How to reduce file size of an Android app

I want to reduce the size of my app. It's a recipe app and relies heavily on images. I have over 50 images with total size 2.8MB. The entire app size is 14MB.

I have individual .java and .xml files for each of the 50 recipes. Is there a way to just use one file for all the recipes and call each image from a single file whenever an item is pressed?

Upvotes: 1

Views: 197

Answers (1)

davidgiga1993
davidgiga1993

Reputation: 2853

There are a lot of different ways to reduce the size of the app. It heavily depends on your needs an requirements.

  1. Use a different image file format like jpg
  2. Use ProGuard to remove and optimize unused code.
  3. Run lint to see if you got unused resources which can be removed
  4. Outsource the images to a webserver and download them if you need them. Again this has a lot of other downsides and depends on your requirements.
  5. Reuse your layout and code: If you logic and layout is similar in each activity (like it is on your example) think about refactoring the code so you can use one layout and one activity for all similar views.

You said the images only consume about 3mb so take a look at point 5,3 and 2.

Upvotes: 2

Related Questions