Reference: Android official website > Development > API Guide > Introduction > Device compatibility
1. Basic Concepts
Android is designed to run on a variety of different types of devices, such as mobile phones, tablets, and TVs. For developers, a huge number of devices provide a huge potential audience for your app. In order for your app to run successfully on these devices, your app should be able to tolerate the differences in some hardware features and provide a flexible user interface that can be adapted to a different screen configuration.
Compatible feature limits (Google Play Store):
- Device features
- Platform versions (Platform version)
- Screen configuration
2. Screen Fit 3. Concept
Screen Size: The physical size of the diagonal of the phone. The common dimensions are 5-inch, 5.5-inch, 6-inch and so on, 1-inch =2.54cm.
Screen resolution: wide and high pixels. Common resolutions: 320x480, 480x800, 720x1280, 1080x1920.
Screen density: pixel density per inch.
Dpi:dots per ICH assumes that there are 160 pixels per inch in the device, then the device's screen pixel density is =160dpi.
Density type |
represents the resolution (PX) |
screen pixel density (dpi) |
Low Density (ldpi) |
240x320 |
120 |
Medium Density (MDPI) |
320x480 |
160 |
High Density (hdpi) |
480x800 |
240 |
Ultra high Density (xhdpi) |
720x1280 |
320 |
Ultra high Density (xxhdpi) |
1080x1920 |
480
|
Density-independent pixels:
Density type |
represents the resolution (PX) |
screen Density (dpi) |
conversion (PX/DP) |
proportions |
Low Density (ldpi) |
240x320 |
120 |
1dp=0.75px |
3 |
Medium Density (MDPI) |
320x480 |
160 |
1dp=1px |
4 |
High Density (hdpi) |
480x800 |
240 |
1dp=1.5px |
6 |
Ultra high Density (xhdpi) |
720x1280 |
320 |
1dp=2px |
8 |
Ultra high Density (xxhdpi) |
1080x1920 |
480 |
1dp=3px |
12
|
Independent proportional pixels:
- Meaning: Scale-independent pixel, called sp or SIP
- Unit: SP
- Android Development uses this unit to set the text size, which can be scaled according to the font size preference
- Recommended to use 12SP, 14SP, 18SP, 22sp as the size of the font settings, do not recommend the use of odd and fractional, easy to cause the loss of precision; fonts smaller than 12sp can be too small for users to see clearly
Android device compatibility (1)