In my app I want use images for every product item. This image must be added to product when user create new item product. What the best approach about size image? (e.g. re-size image in 100x100 px or 200x200 px)
-
I think your question is answered [here][1] [1]: http://stackoverflow.com/questions/5849396/hdpi-ldpi-mdpi-icon-menu-resolution – pshirishreddy Mar 17 '12 at 18:31
-
I mean, user must choice select own image. And this image will added to imagePath (or DB). Also I planed, sent this images on server. Where every user can load this images. – Alexander Shlenchack Mar 17 '12 at 18:39
-
it really depends on your layout – Aashish Bhatnagar Mar 17 '12 at 18:31
2 Answers
About size of Images and memory consumption of an application. This information can save you some painful time with android development.
take under account that most of the time this will affect your app performance e.g. on most cases the used memory of the app will take: x pixels * y pixels * 4 (bytes)
(you can change rgb encoding code to make the last parameter 2 or 1 that will effect image colors)
So 100 * 100 * 4 = 40000 bytes = 40 KB but below and behold: let's take a tablet setup of 1280 * 800 * 4 = 4096000 bytes, which is approximately 4 mega bytes. Taking under account that some devices max RAM for app is 16MB you might be scratching the limit at that setting.
And don't do what I did with:
2560 * 1600 * 4 = ~16MB
That will crash many android devices RAM limit with a little bit more than 16MB per image!! not so adaptable to most devices.
Personally I think that the image in Android development is not very convenient, but maybe they are working to improve it.

- 10,654
- 2
- 52
- 51
-
With this knowledge in mind, how does one make full-screen images without consuming 100% of the memory allocated to the app? Because of the high density of the current generation of handsets, a 1440 x 2560 screen size is not uncommon. – nipponese Jan 14 '15 at 21:33
-
Less detailed images that are compressed is one way to do it. In a small phone it is hard to tell between 1 mega image and 2-4 mega. – sivi Jan 15 '15 at 07:44
All you need to know about what resolution to use for what is given in the android official documentation. The best guide lines are posted here

- 746
- 6
- 20