15

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?

David Storey
  • 29,166
  • 6
  • 50
  • 60
Goran
  • 1,239
  • 4
  • 23
  • 36

7 Answers7

12

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

Sunil Kumar Sahoo
  • 53,011
  • 55
  • 178
  • 243
  • Is this mean, that my app wont be usable on android devices with android 1.6, 2.1 and 2.2 ?? – Goran Aug 08 '11 at 15:33
  • yes. The app wont be usable on on android devices with android 1.6, 2.1 and 2.2 – Sunil Kumar Sahoo Aug 08 '11 at 15:36
  • Ok, then how can i Make my app work on phones and tablets ?? because on the publish site on the market, Tablets are not in supported devices ?? – Goran Aug 08 '11 at 15:39
  • It will be usable on lower API Levels as long as you set `minSdkVersion` to a correct value (like 4 for 1.6 or 7 for 2.1). – inazaruk Aug 08 '11 at 15:40
  • @SunilKumarSahoo I didn't see this warning, till i update adt to 23 and eclipse to 4.x! In past i set xlargeScreen=true and minSdkversion=8 with any error. – Dr.jacky Sep 02 '14 at 16:02
6

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?

magicman
  • 1,199
  • 6
  • 8
  • Ok, and how about premission SEND_SMS ?? – Goran Aug 08 '11 at 20:23
  • I think problem that my app istn shoving more than 469 devices is that I use a android.hardware.telephony ... But can it be removed and my app still can send SMS ?? – Goran Aug 08 '11 at 20:41
  • I dont know what you're app does, but i think you have to remove the part of your app that deals with calling and sending sms, since tablets dont have those features. – magicman Aug 09 '11 at 15:40
4

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."

Roger
  • 56
  • 1
3

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.

inazaruk
  • 74,247
  • 24
  • 188
  • 156
  • I didn't see this warning, till i update adt to 23 and eclipse to 4.x! in past i set xlargeScreen=true and minSdkversion=8. – Dr.jacky Sep 02 '14 at 16:03
2

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.

Lukas Knuth
  • 25,449
  • 15
  • 83
  • 111
  • But then my app wont be usable on android phones with 2.1 and 2.2 android version ?? or am I wrong ?? – Goran Aug 08 '11 at 15:36
  • Ok, then how can i Make my app work on phones and tablets ?? because on the publish site on the market, Tablets are not in supported devices ?? – Goran Aug 08 '11 at 15:38
  • The App will work on tablets even if you don't declare the `xlargeScreens`-attribute. And if you used proper layouts, it will look good on them, too. This attribute was only added for the ["Screen Compatibility Mode"](http://developer.android.com/guide/practices/screen-compat-mode.html) – Lukas Knuth Aug 08 '11 at 15:42
  • But, on market my app isn't showing for tablets. and i tried to install, but it say that it is not compatibile :( – Goran Aug 08 '11 at 15:43
  • Can you copy the APK-file on the memory-card and install it from there? – Lukas Knuth Aug 08 '11 at 15:47
  • dont'know, I don't have a tablet in my posesion :( i will try and write result here... – Goran Aug 08 '11 at 15:50
  • Ok, now i can install an app on tablet, but on market, still says Flyer and other tablets are not supported :( And i tried to put multiple app, and second app has removed premission MAKE_CALL – Goran Aug 08 '11 at 20:26
1

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.

Muhammad Nabeel Arif
  • 19,140
  • 8
  • 51
  • 70
1

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.

Jack
  • 9,156
  • 4
  • 50
  • 75