Q:

Why does 1dp mean 3px and 2px at the same time on Android?

I use the following style for GridView:
<style name="CaldroidDefaultGridView">
    <item name="android:adjustViewBounds">true</item>
    <item name="android:gravity">center_horizontal</item>
    <item name="android:listSelector">@null</item>
    <item name="android:background">@color/caldroid_lighter_gray</item>
    <item name="android:horizontalSpacing">1dp</item>
    <item name="android:padding">1dp</item>
    <item name="android:verticalSpacing">1dp</item>

And it shows 3px for padding and 2px for spacing on Pixel 2 emulator. If I implicitly specify 2px both for padding and spacing, then it shows 2px - so there is no extra pixel anywhere.
It happens in both directions - horizontal and vertical. For padding 1dp always means 3px. For spacing 1dp always means 2px.
Why does 1dp mean 3px and 2px at the same time on Android? How can I get the actual values then? Because I need to know them.
P.S. I understand that it's hard to believe in the stated facts, so I can provide screenshots as the proof.

A:

dp means density-independent pixels. Every smartphone has a different number that goes around 300dp - 420dpi if I don't remember bad. Anyway, your smartphone should have 1920x1080 as screen. So that's because 1dp could be 2-3px at the same time.
You can read more in the official developer android website.
https://developer.android.com/training/multiscreen/screendensities

