I am currently using device wallpaper as my layout background. The bitmap drawable size is very large on on some devices about 7 MB in Samsung S3. Is there any way to reduce this without consuming more RAM. I am worried about OOM on low memory devices.
WallpaperManager wallpaperManager = WallpaperManager.getInstance(mContext);
BitmapDrawable bitmapDrawable = (BitmapDrawable) wallpaperManager.getDrawable();
bitmapDrawable.setGravity(Gravity.CENTER_VERTICAL | Gravity.CLIP_VERTICAL);
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) {
layout.setBackgroundDrawable(bitmapDrawable);
} else {
layout.setBackground(bitmapDrawable);
}