I tried to put a catch around the picture file decoding, but it fails to catch the out of memory exception, and the app crashes.
I know some tricks in decode a picture file, such as subsampling. But I need to zoom in the picture to see details, so I cannot subsample it too much. For some newer devices, it can succeed to allocate a larger memory to avoid the out of memory exception.
For some older devices, it cannot.
If I can customize my applicaiton for different devices, that would be greate.
So I want: (1) I hope I can catech the out of memory exception, so in case I catch it, I can reduce the image size. (2) Or, I hope I can get the size of available memory for allocation.
I search online, fail to find answers.