Android: How to find bitmap extents, which will not crash the app?

view story

http://stackoverflow.com – While trying to decode a bitmap from a web stream I'm occasionally crashing the app in case the bitmap extents exceed the memory size allowed. In order to overcome this I'm using the strategy explained here: http://developer.android.com/training/displaying-bitmaps/load-bitmap.html Since I'm using a careful approach with width and height of 500x500 as input for calculateInSampleSize, I'm having no troubles with memory issues anymore, but customers complain about the poor image quality of the downscaled image. Because there seem no obvious way to me to determine the bitmap extents, which wil (HowTos)