我做了很多尝试,让我的应用与平板电脑兼容,但没有任何效果。这是我试过的:
<uses-feature android:name="android.hardware.telephony" android:required="true" /> <uses-feature android:name="android.hardware.camera" android:required="false" /> <uses-feature android:name="android.hardware.camera.front" android:required="false" />
还为支持的屏幕添加了此代码:
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
我也有min sdk到8。
我真正感到困惑的是,我有一个已经存储的应用程序没有使用任何这些,它的最小sdk是8,它说它与平板电脑兼容。它只有可绘制的文件夹,布局文件夹和在这个应用程序中我也有/ res文件夹之外,图像文件夹像Images-ldpi,images-hdpi等与我在可绘制文件夹中的相同图像。
通过谷歌我对第一个应用程序做了什么应该已经工作,但它没有。
我在平板电脑上无法使用的应用程序:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp"
android:versionCode="6"
android:versionName="1.0.6" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-feature
android:name="android.hardware.telephony"
android:required="true" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.front"
android:required="false" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<application
android:allowBackup="true"
android:icon="@drawable/olympialogo"
android:launchMode="singleTop"
android:logo="@drawable/olympialogo"
android:theme="@style/AppTheme" >
<receiver
android:name="com.myapp.BootCompleted"
android:enabled="true"
android:exported="false" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service android:name="com.myapp.BackgroundActivity" />
<receiver android:name="com.myapp.SMSreceiver" >
<intent-filter>
<action android:name="android.provider.telephony.SMS_RECEIVED" >
</action>
</intent-filter>
</receiver>
<activity
android:name="com.myapp.Splash"
android:label="@string/title_activity_splash"
android:launchMode="singleTop"
android:screenOrientation="sensorPortrait"
android:theme="@android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.myapp.MainActivity"
android:label="@string/app_name"
android:screenOrientation="sensorPortrait" >
<intent-filter>
<action android:name="splashscreen" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.myapp.NumbersActivity"
android:launchMode="singleTop"
android:screenOrientation="sensorPortrait" >
</activity>
<activity
android:name="com.myapp.CodesActivity"
android:launchMode="singleTop"
android:screenOrientation="sensorPortrait" >
</activity>
<activity
android:name="com.myapp.SendCode"
android:launchMode="singleTop"
android:screenOrientation="sensorPortrait" >
</activity>
<activity
android:name="com.myapp.SettingsActivity"
android:launchMode="singleTop"
android:screenOrientation="sensorPortrait" >
</activity>
<activity
android:name="com.myapp.AllMessages"
android:launchMode="singleTop"
android:screenOrientation="sensorPortrait" >
</activity>
<activity
android:name="com.myapp.ButtonsActivity"
android:launchMode="singleTop"
android:screenOrientation="sensorPortrait" >
</activity>
<activity
android:name="com.myapp.OutputActivity"
android:launchMode="singleTop"
android:screenOrientation="sensorPortrait" >
</activity>
<activity
android:name="com.myapp.AboutActivity"
android:launchMode="singleTop"
android:screenOrientation="sensorPortrait" >
</activity>
<activity
android:name="com.myapp.Help"
android:launchMode="singleTop"
android:screenOrientation="sensorPortrait" >
</activity>
<activity
android:name="com.myapp.TechInfo"
android:launchMode="singleTop"
android:screenOrientation="sensorPortrait" >
</activity>
</application>
</manifest>
这是平板电脑兼容的应用程序的清单,但在清单中根本没有设置:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="lol.loltimers"
android:versionCode="3"
android:versionName="1.3" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:icon="@drawable/lolicon"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/activity_main"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".TimersActivity"
android:label="@string/activity_timers"
android:screenOrientation="portrait" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.loltimers.MainActivity" />
</activity>
<activity
android:name=".ThreeTimersActivity"
android:label="@string/activity_three_timers"
android:screenOrientation="portrait" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.loltimers.MainActivity" />
</activity>
</application>
</manifest>
答案 0 :(得分:2)
你需要在drawable中创建不同的文件夹
对于标签,您必须制作宠物标签爆燃
然后在维度文件中进行更改
如果您有特殊的布局要求,那么您需要制作不同的布局
检查此链接 http://android-developers.blogspot.in/2011/07/new-tools-for-managing-screen-sizes.html
答案 1 :(得分:1)
您需要设置
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
并在运行时检查设备是否具有消息传递功能。