0

I have an app that can among others zoom images using chris bane's PhotoView.

When i load large images i get "OutOfMemoryError"

When i add this

     <application ... android:largeHeap="true">

to AndroidManifest.xml

I get a more specific error message with my android-4.4 device

    Bitmap too large to be uploaded into a texture (7087x1022, max=4096x4096)

My question: is there an api (or something else) that tells me that my current android device has a limit of 4096x4096 ?

k3b
  • 14,517
  • 7
  • 53
  • 85
  • 1
    you can query the `GL_MAX_TEXTURE_SIZE` from the runtime environment using `glGetIntegerv`. There's a code sample in this answer: http://stackoverflow.com/a/8573543/49489 – Barend Sep 14 '15 at 07:16
  • this may help you - http://developer.android.com/training/displaying-bitmaps/manage-memory.html – Saket Mittal Sep 14 '15 at 08:12
  • @Saket Mittal: the training explains how to scale down and how to find out image size in bytes (hight*with*4) but not how to caclulate maxWidth and maxHeight which i was asking for. – k3b Sep 14 '15 at 09:56

0 Answers0