I'm developing an android app with multiple fragment which every one contains multiple different bitmaps from other fragments. Due to the large size of the .apk file providing those bitmaps for every drawable density folder, i've decided to provide a single high resolution bitmap (a single high res bitmap for every different one from every different fragment) allocated in drawable-xxhdpi and scale it down at runtime depending on device screen resolution and/or density.
I'm a bit confused about scaling bitmaps according to Andropid developer guide about Displaying Bitmaps Efficiently I can't understand if this code scale bitmaps to screen resolution in pixels, or screen density, or both.
As i can see in this code:
mImageView.setImageBitmap( decodeSampledBitmapFromResource(getResources(), R.id.myimage, 100, 100));
It creates a 100x100 image thumbnail, so i supose i have to pass screen resolution or screen density width and height in these parameters, but not sure...
How can I match scaled bitmaps to screen configuration?
Thanks to every answer.