For readibility, I posted the code examples that my solutions refer to first, and thenI listed the explanations of my solutions in a numerical list.
I have been
A simple and straightforward way is to use "inJustDecodeBounds" property of Options. Set this property to true for options object you created, then continue to decode stream.
The bitmap returned will be null, which means no memory is allocated to it, but you can read the dimensions of the bitmap and thus determine its size and adjust the inSampleSize ratio.
Later reset inJustDecodeBounds to false, by now you know the scale down factor, thus bitmap of required size can now be generated.
Hope this helps.