1

I have a problem. My app use 20MB of ram so I want to avoid mobile phone that have heap less than 20MB. I tried with Runtime.getRuntime.maxMemory() but this function retrieve me the wrong result (256MB on SGS3) because I want to retrieve the available heap for a single app.

How can I detect it? There is an attribute in the manifest?

Thanks.

David Martinelli
  • 203
  • 5
  • 16

1 Answers1

1

What you need is getMemoryClass

 ((ActivityManager) getSystemService(Context.ACTIVITY_SERVICE)).getMemoryClass();

it returns the approximate per-application memory class of the current device.

Blackbelt
  • 148,780
  • 26
  • 271
  • 285