如何让 Android Phonegap 可用于平板电脑? [英] How to make android Phonegap available for tablets?
问题描述
我刚刚使用 Phonegap 创建了一个 Android 应用程序并将其部署到商店.它只是显示网站的内容.我遇到的问题是,即使在清单文件中包含此应用程序后,此应用程序也仅对移动设备可见,对平板电脑不可见:
I just created an Android application using Phonegap and deployed it to the store. It simply shows the content of a website. The problem I'm having is this application is visible to Mobile devices only, not tablets, even after including this in the manifest file:
<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" />
<screen android:screenSize="large" android:screenDensity="ldpi" />
<screen android:screenSize="large" android:screenDensity="mdpi" />
<screen android:screenSize="large" android:screenDensity="hdpi" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />
<screen android:screenSize="xlarge" android:screenDensity="ldpi" />
<screen android:screenSize="xlarge" android:screenDensity="mdpi" />
<screen android:screenSize="xlarge" android:screenDensity="hdpi" />
<screen android:screenSize="xlarge" android:screenDensity="xhdpi" />
</compatible-screens>
我不知道该怎么办.我正在测试的平板电脑是 Acer A100 7",运行 Android 版本 4.0.3.
I don't know what to do. The tablet I'm testing on is an Acer A100 7", running Android version 4.0.3.
更新
这是清单文件:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rakoty.rakoty"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:resizeable="true"
android:anyDensity="true" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<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_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<compatible-screens>
<!-- the screen part from above -->
</compatible-screens>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
推荐答案
根据我在 Play 商店中看到的内容,您在清单中拥有 RECORD_AUDIO
权限.默认情况下,这意味着设备必须有麦克风,而某些平板电脑则没有.考虑添加:
Based on what I can see in the Play Store, you have the RECORD_AUDIO
permission in your manifest. By default, that means that the device has to have a microphone, and some tablets will not. Consider adding:
<uses-feature android:name="android.hardware.microphone" android:required="false" />
同样,您拥有 RECEIVE_SMS
权限,默认情况下需要设备具有电话功能,而大多数平板电脑没有.请考虑添加:
Similarly, you have the RECEIVE_SMS
permission, which by default requires the device to have telephony capability, and most tablets do not. Please consider adding:
<uses-feature android:name="android.hardware.telephony" android:required="false" />
等等.
我建议您将您的权限与文档中的说明进行比较,以查看您可能还需要添加哪些内容:http://developer.android.com/guide/topics/manifest/uses-feature-element.html#permissions
I recommend that you compare your permissions with the instructions in the documentation to see what else you might need to add: http://developer.android.com/guide/topics/manifest/uses-feature-element.html#permissions
这篇关于如何让 Android Phonegap 可用于平板电脑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!