1

I found some game apps use larger memory than the default limit (64MB in Nexus 7).

To achieve that, I assume they set the android:largeHeap="true"

In my codes, I want to check if an app set this flag or not. Any clue?

JackWM
  • 10,085
  • 22
  • 65
  • 92

1 Answers1

3

Check for ApplicationInfo objects with FLAG_LARGE_HEAP. You can get these objects from PackageManager (e.g., via getApplicationInfo()).

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thanks! May I double check the codes: `int flags = applicationInfo.flags; int isLargeHeap = (flags | applicationInfo.FLAG_LARGE_HEAP);` ? – JackWM Mar 03 '13 at 17:05
  • @JackWM: I think you want `&` and not `|`. http://stackoverflow.com/a/6067438/115145 – CommonsWare Mar 03 '13 at 17:42