1. The display density of the device is determined by two factors: the size of the device and the resolution of the device. The larger the size of the same resolution device, the smaller the display density, the higher the resolution of the device with the same size, the greater the display density.
2. Display density rating: 160/240/320/...
3. At different display densities, the conversion ratio of DP to PX is not the same:
When the density is 160, 1DP = 1px; When the density is 240, 1DP = 1.5px; Density is 1DP = 2DP;
4. In Android, the general width is high with DP,
5.-?? in different drawable DPI folder (such as drawable-hdpi), the same name, the same meaning of the picture, when the final app runs on different display density devices, will be limited to use the corresponding drawable folder picture.
6. The new version of ADT recommends replacing the Drawable folder with the Mipmap folder (because some density levels are not 160/240/320/... But the mipmap between them will be better dealt with.
7. Graphical resources should be stored in the Drawable folder, or in the drawable-nodpi folder.
8. Make the Fillet button:
1) Create an. xml file (file name does not need to add. xml) such as: Button_shape, choose Resource Type:shape,
2) <corners
android:radius= "10DP"//radius of the Circle
/>//Fillet
3) <gradient
Android:startcolor: "#ff00ff"
Android:centercolor: "#00ffff"
Android:endcolor: "#ffff00"
/>//Gradient color, (if you want to use a color, you can set the StartColor and EndColor to the same color can be achieved)
4) Android:[email the button Protected]/button_shape
9. Android is not recommended to write a string in the program, it is recommended to write in @string
10. Language International and Adaptive: device switching in different locales, the text on the app also switches automatically. You do this by creating a folder under Res that values-a language name (such as Chinese: values-zh), and then using an XML file under the file to store the text resource (string resource). Add: Folder full name (values-language name-R region name, such as: VALUES-ZH-RHK), language name all lowercase, region name all uppercase.
Android Basics (Device display density/image adaptive