I am making app for phones, but I wan’t them to be usable on tablets. I don’t know why can’t. I use this in my android manifest file:
android:xlargeScreens="true"
I get this error:
error: No resource identifier found for attribute 'xlargeScreens' in package 'android'
This is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cro.perger.bonbon"
android:versionCode="5"
android:versionName="1.4">
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".bonbon"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Broadcast Receiver that will process AppWidget updates -->
<receiver android:name=".HelloWidget" android:label="@string/w_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/hello_widget_provider" />
</receiver>
<receiver android:name=".SMSReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
</application>
<supports-screens android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<uses-permission android:name="android.permission.SEND_SMS"></uses-permission>
<uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.READ_SMS"/>
</manifest>
What should I do?
It looks like you need to build different APKs for older and new versions. Checkout out the blog posted on http://android-developers.blogspot.com/search/label/Android%20Market about multiple APK support: "Multiple APK support gives you a variety of ways to control app distribution. For example, you could use it to create separate APKs for phones and tablets under the same product listing."
Please check your project Build Target To support xlarge screen your project build target should be atleast android 2.3.3 adk.
In Eclipse -?right click on project -> Properties -> Android -> Select Project Build Tagrget as 2.3.3 or onwards
My application supports android versions 1.5 to the latest version and this is what I have in my manifest:
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true" />
This is what shows up on the android market developer site for my app:
Screen layouts: SMALL NORMAL LARGE XLARGE
Required device features
android.hardware.touchscreen
This application is available to over 555 devices.
Also, my project build target is 2.3.3, but I still have many installs on devices running android 3.0
And this is just a guess, im not sure about this, but wouldn't including permissions like CALL_PHONE filter your application from search on a tablet since they dont have that feature?
You need to use at least android API Level 9 for android:xlargeScreens
to be recognized in AndroidManifest.xml
.
For this make sure in your default.properties
file you have target=android-9
or higher. This also can be set using Project Properties, in Android section.
The problem is your minSdkVersion
.
The xlargeScreens
-attribute was introduced in API-Level 9. Since you specified that your application will probably run under API-Level 4, android can't find this attribute.
Change the minSdkVersion
-attribute to 11
and it should work.
The targetSdkVersion
-attribute, which you set to be 11
only indicates that the App was developed to target this version (so it's "recommended"), but the minSdkVersion
specifies the minimum API-Level, see here.
What is your API level set to? It says in the documentation that it requires API 9 or higher. 9 is 2.3. See this link which says:
android:xlargeScreens Indicates whether the application supports extra large screen form-factors. An xlarge screen is defined as a screen that is significantly larger than a "large" screen, such as a tablet (or something larger) and may require special care on the application's part to make good use of it, though it may rely on resizing by the system to fill the screen. The default value for this actually varies between some versions, so it's better if you explicitly declare this attribute at all times. Beware that setting it "false" will generally enable screen compatibility mode. This attribute was introduced in API level 9.
android:xlargeScreens :
This attribute was introduced in API level 9 (Android 2.3.3). If you have your build target lesser than API level 9, then you will get error "No resource identifier found for attribute 'xlargeScreens' in package 'android"
Set your build target to API level 9 or above and this error will vanish.
来源:https://stackoverflow.com/questions/6984488/can-t-use-androidxlargescreens-true