0

I'm developing an Android app and I would like to support multiple screens.

I checked the dashboard in the link below and there are 10 types of screen configuration in use: http://developer.android.com/about/dashboards/index.html#Screens

I got the dimension of the screens from the link below: http://developer.android.com/guide/practices/screens_support.html#testing

and then I created the following emulators to test my app on:

  • large_ldpi_2.3_800x480_120
  • large_mdpi_2.3_800x480_160
  • large_xhdpi_2.3_800x480_320
  • normal_hdpi_2.3_800x480_240
  • normal_ldpi_2.3_400x240_120
  • normal_mpdi_2.3_480x320_160
  • normal_xhdpi_2.3_960x640_320
  • small_hdpi_2.3_640x480_240
  • small_ldpi_2.3_320x240_120
  • xlarge_mdpi_2.3_1280x800_160

format:

<size>_<density>_<android version>_<size>_<density>

Am I doing this right? What is the best practice?

4

2 回答 2

0

在我看来,当您测试您的应用程序时,无需担心模拟器的大小。当您的应用程序在设备上运行时,有三个文件夹用于放置不同分辨率的不同图像,当您在真实设备上运行应用程序时,应用程序会为设备选择最佳分辨率图像。

于 2013-02-13T05:31:40.460 回答
0

有特定的 Android API 调用可以在运行时告诉您手机的密度和(小/大/正常)屏幕尺寸。但是,作为开发人员,我们根本不需要担心个别手机。我们需要做的就是在 apk 中有 ldpi/mdpi/hdpi 资产和小/正常/大布局。Android 在内部处理一切。

不要忘记深入了解 Android 如何确定要使用的资产和类似这样的别名。

定义是:

超大屏幕至少为 960dp x 720dp。

大屏幕至少为 640dp x 480dp。

普通屏幕至少为 470dp x 320dp。

小屏幕至少为 426dp x 320dp。(Android 目前不支持比这更小的屏幕。)

以下是更多关于如何在真实屏幕上工作的示例:

QVGA 屏幕为 320x240 ldpi。转换为 mdpi(4/3 比例因子)给我们 426dp x 320dp;这与上面小屏幕桶的最小尺寸相匹配。

Xoom 是一款典型的 10 英寸平板电脑,具有 1280x800 mdpi 屏幕。这会将其放入 xlarge 屏幕存储桶中。

Dell Streak 是 800x480 mdpi 屏幕。这会将其放入大号桶的底部。

典型的 7 英寸平板电脑具有 1024x600 mdpi 屏幕。这也算大屏幕。

于 2013-02-13T05:32:36.443 回答