开发者

Android Tablets resolution and density support

开发者 https://www.devze.com 2023-03-31 15:49 出处:网络
Hello Everyone......... I am working on android tablets that supports 1280x800 and 1024x600 resolution.

Hello Everyone.........

I am working on android tablets that supports 1280x800 and 1024x600 resolution. What is the best approach for UI design to use dip or px for layout designing. My problem is I want 开发者_Python百科to support all Android Tablets in market with both of these resolutions but there LCD density may vary between 160 to 240 dpi.

  • What to do in this situation?

  • Android tablets have 240 dpi density or 160 dpi density or may have both?

  • Please tell which tablets devices have which density support?

  • Is it possible to workon both densities with same screen resolution through same xml layout?


yes make sure, we make a single layout thate work for all screen or tabs in any density. Android provide multiple support screen features.

<supports-screens android:resizeable="true"
        android:largeScreens="true" android:normalScreens="true"
        android:anyDensity="true"></supports-screens>

and also putup all imeges in

  1. hdpi folder
  2. mdpi folder
  3. ldpi folder


For layout designing dip is definitely the best approach because you have density independence :

http://developer.android.com/guide/practices/screens_support.html

As far as I know, since dpi is dots per inch if you have one resolution you should only have one density.

For calculating easily density see :

http://members.ping.de/~sven/dpi.html

http://en.wikipedia.org/wiki/Comparison_of_Android_devices#Tablet_computers


I have just written a blog post to solve your problem: http://onemanmobile.blogspot.com/2012/04/how-to-scale-your-android-layouts-to.html

This will give you a tool so you only have to define your layout xml-files for a single density bucket (small/normal/large/xlarge) and have it scale proportionally for tablets and small devices.

0

精彩评论

暂无评论...
验证码 换一张
取 消