代码改变世界

Head Fisrt Android Development读书笔记(4)Multiple Device Support

2012-10-11 12:25  java20130722  阅读(185)  评论(0)    收藏  举报

in apk webserver

add the mime type application/vnd.android.package-archive fro the .apk extension

 

portrait mode \ landscape mode intellij

android2.3.3 :

portrait:

landscape:

android 4.1 landscape:


(如果有人知道为什么不同的android版本在landscape上显示会不同的原因,请留言,谢谢)


landscape: res/layout-land/main.xml

small: res/layout-small.main.xml


 

Two properties that effect the way your application looks:

Screen size: the number of horizontal and vertical pixels on a screen.

Pixel Density:the abstracted number of pixels in an inch square.

 

different images for different pixel densities

hdpi: high pixel density (around 240 DPI)

mdpi: medium (around 160 DPI)

ldpi: low (around 120 DPI)

 

Real size is the whole reason for the pixel density groupings.

for 240 pixel width icon, will displayed for 1 inch in 240 pixel and 2 inch for 120 pixel

 

pixel demensions for launcher icons at each pixel density.

low: 36*36

medium: 48*48

high: 72*72


Set icon:

res/drawable-hdpi/icon.png

 <application android:label="@string/app_name" android:icon="@drawable/icon">