Differences between Android px, dp, pt, and sp
Android, such as px (pixel) mm, is not recommended.
Why can I use web development on a computer instead of Android?
Because px indicates the number of pixels, the resolution is usually the same on the computer.
Both 14-inch and 15-inch versions are 1366*768, and the resolution of mobile phones is generally different.
Googe solution:
Dp (dip) (calculated by Pixel based on screen density)
For mobile phones of the same screen size, the density (resolution) varies. When px is used, the view with different sizes is displayed. The component with the same dp length is used, and the final display size is the same.
Suggestion:
Dp (dip) indicates the width and height of the control.
Sp text size
Resolution problems:
Example: 320*480 (5-inch)
Representative: There are 320 pixels in the horizontal direction
The portrait has 480 pixels
480*800 (5 inches)
The screen size is as big as pixels, and the point density is high.