0

In my android application(android:minSdkVersion="13",android:targetSdkVersion="19") I am creating multiple apks on the basis screen size compatability.

In the manifest of apk which supports large devices I have given -

<supports-screens android:smallScreens="false"
                  android:normalScreens="false"
                  android:largeScreens="true"
                  android:xlargeScreens="true"
                  android:requiresSmallestWidthDp="600" />

I want to know what tag should I define in the manifest of apk supporting small,normal and large devices(whose sw is less than 600dp). I read developer android tutorials and it mentioned that you must also set android:largeScreens="true",android:xlargeScreens="true" in the apk supporting small,normal devices.I did not get that part.

Also version code of the apk supporting large and x-large devices will be higher so that google play while downloading the app for user checks that apk first.

Note- Minimum supported sdk version is 3.2.

PS: Developer android says this -

Caution: If you use the <supports-screens> element for the reverse scenario (when your application is not compatible with larger screens) and set the larger screen size attributes to "false", then external services such as Google Play do not apply filtering. Your application will still be available to larger screens, but when it runs, it will not resize to fit the screen. Instead, the system will emulate a handset screen size (about 320dp x 480dp; see Screen Compatibility Mode for more information). If you want to prevent your application from being downloaded on larger screens, use <compatible-screens>, as discussed in the previous section about Declaring an App is Only for Handsets.

what is meant by this? Suppose I give all supports(all sizes) to be true for other apk.Then google play will check the manifest of higher version first and if it satisfies then it will download that version for the user because multiple apks follows rules that if more than one apk supports a device then apk with higher version is preferred.Am I right or not in this regard?

akg
  • 670
  • 10
  • 30

1 Answers1

0

Since your targetSdkVersion is higher than 11, you do not need to set any attributes to true--they are by default. Thus, you should simply set all attributes to false except for the target screen-size that particular build is supporting.

Thus, your largeScreens build supports-screens would look like this:

<supports-screens android:smallScreens="false"
                  android:normalScreens="false"
                  android:largeScreens="true"
                  android:xlargeScreens="false" />

smallScreens build would be:

<supports-screens android:smallScreens="true"
                  android:normalScreens="false"
                  android:largeScreens="false"
                  android:xlargeScreens="false" />

And so on. Google Play allows multiple APKs to be uploaded and filters automatically based on the supports-screen attribute. More here: http://developer.android.com/google/play/filters.html

However, you should be aware of this warning from Google regarding building multiple APKs for different screens:

Note: The Android system provides strong support for applications to support all screen configurations with a single APK. You should avoid creating multiple APKs to support different screens unless absolutely necessary and instead follow the guide to Supporting Multiple Screens so that your application is flexible and can adapt to all screen configurations with a single APK. http://developer.android.com/google/play/publishing/multiple-apks.html

Jeffrey Mixon
  • 12,846
  • 4
  • 32
  • 55
  • thanks for the answer.But my query is that for second apk I want devices with sw>=600dp which I have defined in the manifest.Do I need to define other fields also such as android:largeScreens="true" because developer android says that you need to define this only when you want to support android versions less than 3.1 – akg Nov 02 '14 at 22:40
  • also how to differentiate between devices just on the basis of 'sw' of the devices – akg Nov 02 '14 at 22:41