我最近将我的应用上传到 Play 商店,它只支持手机和平板手机。因此,根据https://developer.android.com/guide/practices/screens-distribution.html,我插入以下代码以仅支持手机和平板手机
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.xxx.yyy.permission.C2D_MESSAGE" />
<compatible-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" />
<screen android:screenSize="small" android:screenDensity="xxhdpi" />
<screen android:screenSize="small" android:screenDensity="xxxhdpi" />
<screen android:screenSize="small" android:screenDensity="420" />
<screen android:screenSize="small" android:screenDensity="480" />
<screen android:screenSize="small" android:screenDensity="560" />
<screen android:screenSize="small" android:screenDensity="640" />
<!-- 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" />
<screen android:screenSize="normal" android:screenDensity="xxhdpi" />
<screen android:screenSize="normal" android:screenDensity="xxxhdpi" />
<screen android:screenSize="normal" android:screenDensity="420" />
<screen android:screenSize="normal" android:screenDensity="480" />
<screen android:screenSize="normal" android:screenDensity="560" />
<screen android:screenSize="normal" android:screenDensity="640" />
</compatible-screens>
<application android:name=".AppApplication"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:largeHeap="true"/>
当三星 S8 尝试安装时,奇怪的事情开始出现。它将具有三种可能性。华为Mate 9也有类似情况。
我的问题是,我该如何解决这个问题?Google Play Console 表示支持除我上面提到的平板电脑之外的所有设备。还是与最近的手机刚刚实施的 WQHD 相关?
编辑:该问题仅发生在升级到最新固件的人身上,这使手机能够支持 WQHD。
除了@Khalid 的回答,使用<support-screens>
将启用屏幕兼容模式并让平板电脑用户能够下载。
这是不可避免的,因为<compatible-screens>
无法区分使用户能够动态设置分辨率(HD+、FHD+ 和 WQHD+)的较新版本的 Android(或三星),并且无法真正确定屏幕密度。
为了解决这个问题,我在应用程序启动时添加了一个验证器来检查屏幕大小。
public boolean checkUnsupportedSize() {
int screenSize = this.getResources().getConfiguration().screenLayout &
Configuration.SCREENLAYOUT_SIZE_MASK;
switch(screenSize) {
case Configuration.SCREENLAYOUT_SIZE_SMALL:
return false;
case Configuration.SCREENLAYOUT_SIZE_NORMAL:
return false;
default:
return true;
}
}
if (checkUnsupportedSize()) {
YourActivity.this.finish();
}
由于手机和平板手机总是使用小和正常的屏幕尺寸,我们可以区分其他屏幕尺寸并强制应用程序退出。
在 Google Play 对手机、平板手机和平板电脑进行适当的过滤之前,这是我能想到的解决方法。
干杯。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句