简体   繁体   中英

how to make my application support for all devices resolution

I have develop an app which runs very well in my emulator and in my Samsung device. But when I test it in the Motorola emulator, which I have downloaded in my android SDK, it doesn't work. Can anyone help me out to figure this problem of supporting multiple devices?

You can add following code in your AndroidManifest.xml to support different screens.

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

Check this for more details http://developer.android.com/guide/topics/manifest/supports-screens-element.html Hope this will help you.

It is not really clear what is your problem, but often if the resolution changes the layout problems can be many. One of them is the unit used in the xml of the layout:

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:textSize="13px"
                android:paddingLeft="10px" />

in this case for example textSize is in pixel, which can be small or bigger depending from the DPI of te screen. You can change this specify other units of measurements like points:

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:textSize="13pt"
                android:paddingLeft="10pt" />

put more details in your question.

我很大程度上取决于您的问题所在,但是如果问题是您的应用无法安装,请尝试将其添加到AndroidManifest中

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

SDK 1.5 did not support the drawable sub-folders ( /hdpi , /mdpi & /sdpi ) for the different resolutions. If you need your App to work on all SDKs, you should put all your drawables in the /drawable folder (not its subfolders).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM