4 ms·
No, there's actually a 3rd solution which is what Android uses: (3) Expose both pixels and dips. Both are first-class units in Android. The 2D drawing API work
by kllrnohj 12y ago
No, there's actually a 3rd solution which is what Android uses:
(3) Expose both pixels and dips. Both are first-class units in Android. The 2D drawing API works exclusively in pixels, but the layout commonly works in DIPs instead.
Developers then do their layouts in dips but custom 2D drawing in pixels. Or really most anything in code is using pixels, dips are largely contained in the XML layout files.