0


I am developing an Android app with many drawable resources so the heap memory is growing too much, maybe to >28MB. My app has 3 Activities switching each other when using, each of them has a different background and currently, I just simply set

 "android:background = "@drawable/bg.." 

to each parent Layout.

My questions are:

1) Do we need to create a full pixels drawable design? I meant 480x800 for mdpi or 720x1280 for xhdpi... Is there a way that the design still good when pixels is smaller than screen? How?

2) Suppose I have the designed resources with full screen, how I set the background with the lowest heap using? The "android:background" propertie in XML is not good way, with "Displaying Bitmaps Effeciently" the inSampleSize is always 1 because of fullscreen designs, if I manual set inSampleSize > 1 the background is blurry.

Thanks and best regards!

Neha Shukla
  • 3,572
  • 5
  • 38
  • 69
NamNH
  • 1,752
  • 1
  • 15
  • 37
  • rather than setting drawable to background try to create theme style for that and set it to your activity. it will consume less memory load. and yeah you have to be careful with your heap memory management. – Pragnesh Ghoda シ May 29 '15 at 04:46
  • How about the design background? Could you give me a sample link or docs about the theme style you mentioned? – NamNH May 29 '15 at 04:58
  • If you persist on using images at least use patterns so that you use lower memory. they will be redrawn if you know how to use them and it's more efficient. – M. Erfan Mowlaei May 29 '15 at 05:01

0 Answers0