-1

i am making an application and on the start of application i want to display a picture but i get this out of memory exception. i used a lot of shared Preferences in the code that is not yet executed. so this rises 2 questions -

is memory for shared Preferences allocated at the beginning itself ?

and is the memory for shared Preferences allocated in the apps heap memory ?

should i clear the shared preferences and use database instead . will that solve the problem ?

sarath
  • 45
  • 8

1 Answers1

0

Android hardware must at least support 2048x2048.

For OpenGL I used:

int[] maxSize = new int[1];
gl.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSize, 0);
  • For Nexus 4 it equals to 4096
  • For Sansung 2 it equals to 4096

You can calculate [(Height in pixels) x (length in pixels) x (bit depth)] / 8 / 1024 = image size in kilobytes (KB)

So be sure that you have proper image size.

Hope it will help,

Maxim Shoustin
  • 77,483
  • 27
  • 203
  • 225