1.adb或者串口形式
查看当前屏幕密度:wm density
设置当前屏幕密度:wm density 640
查看当前屏幕密度:wm density reset
2.源码默认设置屏幕密度
frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
private void loadSecureSettings(SQLiteDatabase db) {
SQLiteStatement stmt = null;
try {
..........................
..........................
//修改默认屏幕密度
loadStringSetting(stmt, Settings.Secure.DISPLAY_DENSITY_FORCED, R.string.display_density_forced);
..........................
..........................
} finally {
if (stmt != null) stmt.close();
}
}
frameworks/base/packages/SettingsProvider/res/values/defaults.xml
<string name="display_density_forced">640</string>
3.屏幕密度与最小宽度
在分辨率不变的前提下,修改了最小宽度之后,设备的density会随之改变,反之也一样