@phoebus===
though there is a lot of time i dont use p5 for android it seems to me that the "standard" way for android native geting density can be used:
DisplayMetrics metrics = getResources().getDisplayMetrics();
(that you must adapt for fragment:)
this.getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics);
then ask for what you want (width, height, density...)
in this case:
float SCREEN_DPI = metrics.densityDpi;
note that this will return not the Real device density but one of the constant values used by android for classifying devices (160 = mdpi...)
Answers
@phoebus=== though there is a lot of time i dont use p5 for android it seems to me that the "standard" way for android native geting density can be used: DisplayMetrics metrics = getResources().getDisplayMetrics(); (that you must adapt for fragment:) this.getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics); then ask for what you want (width, height, density...) in this case: float SCREEN_DPI = metrics.densityDpi; note that this will return not the Real device density but one of the constant values used by android for classifying devices (160 = mdpi...)