It looks like GetDisplayDPI is only implemented on Windows, macOS, and X11 currently.
Looking at the Android docs a bit,
160 * getResources().getDisplayMetrics().density; would give a DPI based on the UI scale factor.
There are also
ydpi fields of DisplayMetrics which are supposed to be the real physical DPI of the screen. I’m not sure how useful these are through.
It might make sense to add a separate API to SDL for physical DPI and scale factor… although you can get the scale factor by dividing
SDL_GetWindowSize (only on macOS/iOS currently).
DPI is not a great way to express scale factor because every platform uses a different “base” DPI; on Windows this is 96 and macOS it’s 72 and Android it’s 160.