android 屏幕分辨率的适配
来源:互联网 发布:互联网数据研发部 编辑:程序博客网 时间:2024/06/05 17:56
http://developer.android.com/guide/practices/screens_support.html
测试屏幕分辨率的适配
How to Test Your Application on Multiple Screens
Before publishing your application, you should thoroughly test it in all of the supported screen sizes and densities. The Android SDK includes emulator skins you can use, which replicate the sizes and densities of common screen configurations on which your application is likely to run. You can also modify the default size, density, and resolution of the emulator skins to replicate the characteristics of any specific screen. Using the emulator skins and additional custom configurations allows you to test any possible screen configuration, so you don't have to buy various devices just to test your application's screen support.
To set up an environment for testing your application's screen support, you should create a series of AVDs (Android Virtual Devices), using emulator skins and screen configurations that emulate the screen sizes and densities you want your application to support. To do so, you can use the AVD Manager to create the AVDs and launch them with a graphical interface.
To launch the Android SDK Manager, execute the SDK Manager.exe
from your Android SDK directory (on Windows only) or execute android
from the <sdk>/tools/
directory (on all platforms). Figure 6 shows the AVD Manager with a selection of AVDs, for testing various screen configurations.
Table 3 shows the various emulator skins that are available in the Android SDK, which you can use to emulate some of the most common screen configurations.
For more information about creating and using AVDs to test your application, see Managing AVDs with AVD Manager.
WQVGA432 (240x432)HVGA (320x480)WVGA800 (480x800)
WVGA854 (480x854)
600x1024640x960
WVGA854** (480x854)WVGA800* (480x800)
WVGA854* (480x854)
600x1024
1024x768
1280x7681536x1152
1920x1152
1920x12002048x1536
2560x1536
2560x1600* To emulate this configuration, specify a custom density of 160 when creating an AVD that uses a WVGA800 or WVGA854 skin.
** To emulate this configuration, specify a custom density of 120 when creating an AVD that uses a WVGA800 or WVGA854 skin.
† This skin is available with the Android 3.0 platform
To see the relative numbers of active devices that support any given screen configuration, see the Screen Sizes and Densities dashboard.
We also recommend that you test your application in an emulator that is set up to run at a physical size that closely matches an actual device. This makes it a lot easier to compare the results at various sizes and densities. To do so you need to know the approximate density, in dpi, of your computer monitor (for instance, a 30" Dell monitor has a density of about 96 dpi). When you launch an AVD from the AVD Manager, you can specify the screen size for the emulator and your monitor dpi in the Launch Options, as shown in figure 7.
If you would like to test your application on a screen that uses a resolution or density not supported by the built-in skins, you can create an AVD that uses a custom resolution or density. When creating the AVD from the AVD Manager, specify the Resolution, instead of selecting a Built-in Skin.
If you are launching your AVD from the command line, you can specify the scale for the emulator with the -scale
option. For example:
emulator -avd <avd_name> -scale 96dpi
To refine the size of the emulator, you can instead pass the -scale
option a number between 0.1 and 3 that represents the desired scaling factor.
For more information about creating AVDs from the command line, see Managing AVDs from the Command Line
- android 屏幕分辨率的适配
- android屏幕分辨率适配
- android屏幕分辨率适配
- android屏幕分辨率适配
- android屏幕分辨率适配
- Android屏幕分辨率适配
- Android屏幕分辨率适配
- android屏幕分辨率适配总结
- android多屏幕分辨率适配
- Android Studio 屏幕分辨率适配
- 关于android屏幕分辨率适配的知识的整理
- [整理]Android屏幕适配(不同的屏幕分辨率和尺寸)
- Android屏幕适配(不同的屏幕分辨率和尺寸)
- [整理]Android屏幕适配(不同的屏幕分辨率和尺寸)
- Android屏幕适配(不同的屏幕分辨率和尺寸)
- android屏幕分辨率 的获取
- 各种Android设备屏幕分辨率与适配
- Android如何适配不同屏幕分辨率
- 使用SVN进行项目版本管理
- 复制标题和网址
- 玩转SSRS第七篇---报表订阅
- (IOS)Assign VS Retain VS Copy三者的区别与分析总结
- iOS cocos2d 2游戏开发实战(第3版)---你的第一个游戏!
- android 屏幕分辨率的适配
- 项目开发、项目管理中遇到的问题总结
- cocos2d-x box2d物理引擎深入研究 第一篇之平移关节详解(b2PrismaticJoint)
- ORACLE11G内存管理参数
- android常用网站
- HTML5 CORS 跨域ajax .NET 实例
- 不用排序,同一列显示成绩和排名
- Keil中build和rebuild区别
- JQUERY 提交路径在IE产生缓存的处理方法