Can’t use android:xlargeScreens="true"?
Asked Answered
F

7

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?

Fassold answered 8/8, 2011 at 15:25 Comment(0)
F
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."

Foresight answered 8/8, 2011 at 18:13 Comment(0)
D
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

Dingo answered 8/8, 2011 at 15:32 Comment(5)
Is this mean, that my app wont be usable on android devices with android 1.6, 2.1 and 2.2 ??Fassold
yes. The app wont be usable on on android devices with android 1.6, 2.1 and 2.2Dingo
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 ??Fassold
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).Orcutt
@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.Cabot
P
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?

Puerile answered 8/8, 2011 at 18:20 Comment(3)
Ok, and how about premission SEND_SMS ??Fassold
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 ??Fassold
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.Puerile
F
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."

Foresight answered 8/8, 2011 at 18:13 Comment(0)
O
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.

Orcutt answered 8/8, 2011 at 15:33 Comment(1)
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.Cabot
A
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.

Aikido answered 8/8, 2011 at 15:33 Comment(7)
But then my app wont be usable on android phones with 2.1 and 2.2 android version ?? or am I wrong ??Fassold
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 ??Fassold
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"Aikido
But, on market my app isn't showing for tablets. and i tried to install, but it say that it is not compatibile :(Fassold
Can you copy the APK-file on the memory-card and install it from there?Aikido
dont'know, I don't have a tablet in my posesion :( i will try and write result here...Fassold
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_CALLFassold
C
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.

Chesson answered 8/8, 2011 at 15:33 Comment(0)
R
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.

Romance answered 23/4, 2012 at 8:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.