During android development, it is no longer feasible for the artist to design the source image and cut the image according to the interface resolution. The main contradiction is the support of multiple android devices.
For new requirements, artists are often confused about the adaptive images, sizes, and font sizes required by developers.
The following is a summary of my project experience and communication with the artist.
1. design prototype
Similar to website design, you must determine the prototype style during android development. The prototype includes title, background, toolbar, and other commonly used control styles, Font types, and styles.
2. Cut the original image after it is finalized
The original image is segmented by the 9.png technology. If you are not familiar with 9.png, check the network contraction.
3. determine the length of the interface control.
Ui length. dp is recommended for android.
Dp is an abstract unit. android sets the screen width to 320dp. As long as the unit of length uses dp, the ratio to the screen is consistent.
Conversion Relationship between dp and px
Density = 120 when the actual screen resolution is 240px * 400px
The actual screen resolution is 320px * 533px, density = 160
The actual screen resolution is 240 PX * 800px, density =
Conversion Formula: Px = dips * (density/160)
For example, when 320*480, 1px = 1dp
4. Determine the font size.
We recommend that you use sp in the font of android. For sp, it is of the same nature as dp,
Currently, there is no conversion formula for sp and px. We can convert them to sp Based on the font px value in 320*480.