2012年4月28日 星期六

[UI] Supporting Multiple Screens - Terms and Concepts

* Terms and Concepts
  • Screen size (inch)
    • 以螢幕對角線為準,可分為small, normal, large, and extra large。
  • Aspect ratio
    • 螢幕的長寬比。
  • Resolution 解析度
    • The total number of physical pixels on a screen.
  • Density
    • pixel 密度 (the spread of pixels across the physical width and height of the screen)。
    • 可分為 low, medium, large, and extra large。
  • Density-independent pixel (dp)
    • A virtual pixel unit that applications can use in defining their UI, to express layout dimensions or position in a density-independent way。
    • pixels = dps * (density / 160)。
  • px (pixels)
    • 像素,對電腦而言,所有人眼所見的影像都是螢幕上一連串的光點的構成的,這些光點是電腦顯示的最小單位。
    • 光點的數量越多,影像提供的細節就越多。

* Range of screens supported
At run time, the platform handles the loading of the correct size or density resources, based on the generalized size or density of the current device screen, and adapts them to the actual pixel map of the screen.
  • Sizes
    • small, normal, large, and xlarge
  • Densities
    • ldpi (low), mdpi (medium), hdpi (high), and xhdpi (extra high)
    • The xhdpi density category was added in Android 2.2 (API Level 8). 
    • The xlarge size category was added in Android 2.3 (API Level 9).

* Android support application to display resources
  • Pre-scaling of resources (such as image assets)
  • Auto-scaling of pixel dimensions and coordinates
  • Compatibility-mode display on larger screen-sizes

* 若要指定特定長度或大小,要使用以下單位,才不會因為系統的 resolution 不同而呈現不同結果:
  • sp (scaled pixels): 用於字體。
  • dip/dp (density independent pixels): 系統會依比例呈現,使得結果不受 pixel 影響。


* Reference
- Supporting Multiple Screens
- long or notlong
- 關於android系統資源更換-語言切換或配置改變
- 屏幕分辨率
- 关于android多分辨率中的density和density-independent pixel的区别
- 何謂解析度、DPI?
- android平台下单位px,dip,sp的区别

沒有留言:

張貼留言