Android应用程序应该在Play商店中正常的屏幕设备以及片可见,应在两者(屏幕分辨率)出现完美 [英] Android App should visible in playstore for normal screen devices as well as tablets and should appear perfect in both (screen resolution)

查看:353
本文介绍了Android应用程序应该在Play商店中正常的屏幕设备以及片可见,应在两者(屏幕分辨率)出现完美的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近发表在Play商店中的Andr​​oid应用(SDK 4.2版)。我的要求是 - 这个程序应该是Play商店中看到两个 - 大屏幕设备(包括三星Galaxy Tab 2 P3100),以及正常屏幕设备。
我也想显示在设备我的应用程序(与2.2版 - 4.2)。

I have recently published android app (sdk version 4.2) in playstore. My requirement is that - this app should be visible in playstore on both - large screen devices (including Samsung Galaxy Tab 2 p3100), as well as normal screen devices. I also want my app to be displayed in devices (with version 2.2 - 4.2).

这是code片段,我建议对我的要求履行。

This is the code snippet, I was suggested for fulfilment of my requirement.

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

<uses-sdk android:minSdkVersion="8"
    />

有两种情况下,根据上述code。


  1. 当我包括上述code的manifest.xml

  1. When I include the above code in manifest.xml

包括以上code清单中似乎帮助我实现我的
让我的应用程序可见市场为平板电脑的需求,
小屏幕设备。但是,在这种情况下,应用程序的屏幕仅覆盖
平板电脑的一半屏幕大小,从Play商店中/市场下载时
以及它显示在一个类似的方式(包括半屏
部分),而调试的片剂。

Including above code in manifest seems to help me in fulfilling my requirement of making my app visible in market for both tablet and small screen devices. But, in that case, the app screens covers only half screen size of tablet, when downloaded from playstore / market as well as it is displayed in a similar manner (covering half screen part) while debugging in tablet.

当我不包括在上面的code的manifest.xml

When I don't include the above code in manifest.xml

不包括在清单上面code,好像在调试应用程序,因为该应用程序的所有画面,完美地显示在正常屏幕设备(手机)以及大/ X-大量工作完美屏设备(片),但只有在调试的情况下。该应用程序变得Play商店中的药片不可见的。

Not including the above code in manifest, seems to work perfect while debugging the app, as the all screens of the app, are displayed perfectly on normal screen devices (phones) as well as on large / x-large screen devices (tablets), but only in case of debugging. The app becomes invisible in playstore for the tablets.

因此​​,这两种情况下都没有对我的要求的解决方案。

So, both the cases aren't the solution for my requirement.

权限和功能表现在如下

<uses-feature android:name="android.hardware.touchscreen" android:required="false" /> 
<uses-feature android:name="android.hardware.telephony" android:required="false" /> 
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> 
<uses-feature android:name="android.hardware.camera" android:required="false" /> 
<uses-permission android:name="android.permission.READ_CONTACTS" /> 
<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> 
<uses-permission android:name="android.permission.VIBRATE" /> 
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
<uses-permission android:name="android.permission.RECORD_VIDEO" /> 
<uses-permission android:name="android.permission.CAMERA" /> 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
<uses-permission android:name="android.permission.GET_TASKS" /> 
<uses-permission android:name="android.permission.RECORD_AUDIO" /> 
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> 

这是我的布局(XML),平板电脑上调试时仅消耗一半的屏幕尺寸之一。

And here is one of my layout (xml), that consumes only half screen-size when debugging on tablet.

   <?xml version="1.0" encoding="utf-8"?>
   <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:fillViewport="true">

      <RelativeLayout 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/rl"
        android:background="#000000"
        android:focusableInTouchMode="true">

         <LinearLayout
           android:layout_width="fill_parent"
           android:layout_height="40dp"
           android:gravity="center_vertical"
           android:orientation="horizontal"
           android:background="#0074AF">

            <LinearLayout
               android:paddingLeft="5px"
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               android:gravity="center_vertical"
               android:layout_gravity="center_vertical"
               android:orientation="horizontal"
               android:weightSum="10">

                <TextView android:id="@+id/label"
                  android:layout_weight="8.8"
                  android:layout_marginLeft="5dip"
                  android:textSize="22sp"
                  android:textStyle="bold"
                  android:layout_width="wrap_content"
                  android:textColor="#ffffff"
                  android:gravity="center_vertical"
                  android:layout_gravity="center_vertical"
                  android:text="@string/login"
                  android:layout_height="wrap_content"/>

                   <TextView android:id="@+id/version_no"
                     android:layout_weight="1.2"
                     android:textSize="14sp"
                     android:textStyle="bold"
                     android:layout_width="wrap_content"
                     android:textColor="#222222"
                     android:gravity="center_vertical"
                     android:layout_gravity="center_vertical"
                     android:text="@string/version"
                     android:layout_height="wrap_content"/>

             </LinearLayout>
         </LinearLayout>

         <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp"
            android:layout_marginTop="45dp"
            android:background="@drawable/round_borders"
            android:orientation="vertical"
            android:paddingTop="10dp" >

             <TextView
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="5dp"
              android:paddingBottom="0dp"
              android:paddingTop="0dp"
              android:textColor="#000000"
              android:textSize="20px"
              android:text="Username*"
              android:id="@+id/user"/>

             <EditText
               android:id="@+id/name"
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               android:layout_marginBottom="2dp"
               android:paddingBottom="0dp"
               android:paddingTop="0dp"
               android:singleLine="true"
             />

             <TextView
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               android:layout_marginBottom="5dp"
               android:paddingBottom="0dp"
               android:paddingTop="0dp"
               android:textColor="#000000"
               android:textSize="20px"
               android:text="Password*"
               android:id="@+id/pswd" />

             <EditText
              android:id="@+id/pass"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="10dp"
              android:paddingBottom="0dp"
              android:paddingTop="0dp"
              android:singleLine="true"
              android:password="true"
             />

             <TextView
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="5dp"
              android:paddingBottom="0dp"
              android:paddingTop="0dp"
              android:textColor="#000000"
              android:textSize="20px"
              android:text="AccountId*" />

            <EditText
              android:id="@+id/accid"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="10dp"
              android:paddingBottom="0dp"
              android:paddingTop="0dp"
              android:inputType="date"
              android:singleLine="true"
             />

             <CheckBox android:id="@+id/check1"
               android:layout_width="fill_parent"
               android:textColor="#000000"
               android:layout_height="wrap_content"
               android:text="@string/remember_me" />

             <LinearLayout
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               android:orientation="horizontal"
               >

             <Button
               style="@style/RedButtons"
               android:layout_width="270dip"
               android:layout_height="50dip"
               android:layout_marginTop="10dp"
               android:gravity="center"
               android:paddingBottom="3dp"
               android:paddingTop="3dp"
               android:id="@+id/login"
               android:text="@string/login"
               android:textSize="20sp" />

             <Button
               style="@style/RedButtons"
               android:layout_width="0dip"
               android:layout_height="0dip"
               android:layout_marginTop="10dp"
               android:layout_marginLeft="70px"
               android:gravity="center"
               android:paddingBottom="3dp"
               android:paddingTop="3dp"
               android:id="@+id/exit"
               android:text="@string/exit"
               android:visibility="gone" />

            </LinearLayout>

            <LinearLayout 
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="10dp"
              android:layout_marginBottom="5dp"
              android:paddingBottom="0dp"
              android:paddingTop="0dp"
              android:orientation="vertical">

            <TextView
              android:id="@+id/new_user_txt"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"  
              android:textColor="#000000"
              android:textSize="16sp"
            />

        </LinearLayout>
     </LinearLayout>
  </RelativeLayout>
 </ScrollView>

这,而在平板​​电脑和手机调试,屏幕也会显示正常,当我删除的支持,屏幕的code段,并使用-SDK标签从manifest.xml的正常工作。但是,这不是实际的解决方案(如应用程序将被隐藏在Play商店中,在这种情况下),我猜。

That works fine while debugging in both tablet and phone, the screens also appear fine, when I remove the code snippet of supports-screens and uses-sdk tags from the manifest.xml. But, that's not the actual solution (as the app will be hidden in playstore, in that case), I guess.

请让我知道,有什么可以为了摆脱掉这个问题来进行。

Please, let me know, what can be done in order to get rid off this problem.

推荐答案

缩放行为被称为屏幕兼容模式。谷歌建议更改你的布局不要求这种模式。然后,你可以让你的&LT;支持分屏方式&gt; 元素,你有它的方式

The zooming behavior is known as "screen compatibility mode". Google recommends changing your layout not to require this mode. Then you can keep your <supports-screens> element the way you have it.

我没有试过,但它似乎像 largestWidthLimitDp 属性可以用来强制使用的屏幕兼容模式的大型设备。

I haven't tried this, but it seems like the largestWidthLimitDp attribute could be used to force the use of screen compatibility mode for larger devices.

<supports-screens
    android:largestWidthLimitDp="320"
    android:smallScreens="true"
    android:normalScreens="true"
    android:largeScreens="true"        
    android:xlargeScreens="true"/>

这篇关于Android应用程序应该在Play商店中正常的屏幕设备以及片可见,应在两者(屏幕分辨率)出现完美的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆