简体   繁体   English

如何使我的应用程序支持所有设备的分辨率

[英]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. 但是,当我在我的android SDK中下载的Motorola模拟器中对其进行测试时,它不起作用。 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. 您可以在AndroidManifest.xml中添加以下代码以支持不同的屏幕。

   <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. 请检查此以获取更多详细信息, http://developer.android.com/guide/topics/manifest/supports-screens-element.html希望对您有所帮助。

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: 其中之一是布局xml中使用的单位:

<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. 在这种情况下,例如textSize以像素为单位,取决于屏幕的DPI,它可以更大或更小。 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. 对于不同的分辨率,SDK 1.5不支持可绘制的子文件夹( /hdpi/mdpi/sdpi )。 If you need your App to work on all SDKs, you should put all your drawables in the /drawable folder (not its subfolders). 如果需要您的应用程序在所有SDK上都可以运行,则应将所有可绘制对象放在/drawable文件夹(而不是其子文件夹)中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android如何使我的应用在分辨率小于480x800的设备上不可见 - Android how to make my app not visible for devices with resolution smaller than 480x800 ARCore:如何让我的应用在 GPlay 上仅对支持 Depth API 的设备可用? - ARCore: How to make my app available on GPlay only to devices that support Depth API? 是否可以在没有 Firebase Cloud Messaging (FCM) 的情况下向所有安装了我的应用程序的设备发送推送通知? - is it possible to make push notifications to all devices which had installed my application without Firebase Cloud Messaging (FCM)? 如何使PhoneGap Android APP适应所有设备? - How do I make my PhoneGap Android APP fit all devices? 如何支持应用在所有包含指纹功能的设备上运行 - how to support app to run on all devices that contain finger print feature 如何使LibGDX应用程序以与浏览器框架相同的分辨率启动 - How to make a LibGDX application launch at the same resolution as the browser frame 如何使Java使用我的类加载器进行类解析 - How to make Java use my classloader for class resolution 如何设计适用于所有设备的android应用程序的UI? - How to design UI for android application that will compatible for all devices? 如何使应用程序在所有设备上看起来都一样 (android) - How to make a app scale the look the same on all devices (android) 如何在所有设备上同时进行事件触发,而不管时区如何 - How to make event trigger at the same time on all devices regardless of timezone
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM