0

当我说平板电脑时,我的意思是宽高比倾向于更大的方形,换句话说不是16:9。我使用的代码developers.android.com申报程序仅用于手机:如何禁用在平板电脑上运行的应用程序?

<manifest ... > 
    <compatible-screens> 
     <!-- all small size screens --> 
     <screen android:screenSize="small" android:screenDensity="ldpi" /> 
     <screen android:screenSize="small" android:screenDensity="mdpi" /> 
     <screen android:screenSize="small" android:screenDensity="hdpi" /> 
     <screen android:screenSize="small" android:screenDensity="xhdpi" /> 
     <!-- all normal size screens --> 
     <screen android:screenSize="normal" android:screenDensity="ldpi" /> 
     <screen android:screenSize="normal" android:screenDensity="mdpi" /> 
     <screen android:screenSize="normal" android:screenDensity="hdpi" /> 
     <screen android:screenSize="normal" android:screenDensity="xhdpi" /> 
    </compatible-screens> 
    ... 
    <application ... > 
     ... 
    <application> 
</manifest> 

但现在,我出版了我的程序,我无法在手机上安装它是与尺寸2560×1440这是一个手机仍然是16:9。我收到“您的设备与此版本不兼容”消息。

现在我问自己,如果上面的代码不一定是屏蔽平板电脑,而是屏蔽Android可能定义为“非手机”的高分辨率的所有设备。我希望该应用程序可用于任何分辨率的手机,但要被屏蔽到不符合手机纵横比的设备。有没有办法做到这一点?

+0

号为什么你甚至想这样做? – creativecreatorormaybenot

回答

2

但现在,我发布了我的应用程序,我不能将它安装在我的手机上,这是一个尺寸为2560x1440,仍然是16:9的手机。我收到“您的设备与此版本不兼容”消息。

设备的屏幕密度比xhdpi高,你<compatible-screens>元素不超过xhdpi列表中的较高密度的选项。

当我说平板电脑时,我的意思是宽高比倾向于更大的方形,换句话说不是16:9。

有些设备可以运行带有更多正方形长宽比的手机尺寸的Android应用程序(例如BlackBerry Passport)。

我希望应用程序可用于任何分辨率的手机,但要阻止到不符合手机纵横比的设备。有没有办法做到这一点?

相关问题