Density for 1080x1920 is not correct

Johnmcenroy

Active Member
Licensed User
Longtime User
I am testing my application on emulator 1080x1920 5" (Official Sony Z definition) and also 1080x1920 5" (Based on Sony Z profile - Galaxy S4).

B4X:
Sub Process_Globals
  Dim ScreenDensity As Float : ScreenDensity = Density
End Sub


Then in Activity_Create I call:
B4X:
Log(ScreenDensity)

So i get:
240x320 - 0.75 (ScreenDensity)
320x480 - 1
480x800 - 1.5
720x1280 - 2

So all is fine but for 1080x1920 i get also 2 and it must be 3 , dpi is 480
What is wrong ?

Thanks
 
Last edited:

Johnmcenroy

Active Member
Licensed User
Longtime User
That value is what Android is reporting from context.getResources().getDisplayMetrics().density so it is the tablet or emulator that is getting it wrong, if indeed it is wrong and not intentional.

Thanks Agraham for reply. So how i understood on real device such as Galaxy S4 it must be correct ?
 
Upvote 0

yttrium

Active Member
Licensed User
Longtime User
Thanks Agraham for reply. So how i understood on real device such as Galaxy S4 it must be correct ?

Theoretically, yes, on a real device it will display correctly.
 
Upvote 0
Top