warning: [deprecation] scaledDensity in DisplayMetrics has been deprecated

Reference: https://developer.android.com/reference/android/util/DisplayMetrics#scaledDensity

This method is deprecated from API level 34, so if you want to get the dimensions of the application window then you can safely manage this situation with:

DisplayMetrics dm = getResources().getDisplayMetrics();
float scaledDensity;
if (Build.VERSION.SDK_INT >= 34)
    scaledDensity = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1, dm);
else
    scaledDensity = dm.scaledDensity;