3

We have two apks and we want to restrict one apk only to mobile phones and the other one only to tablets on google play store. We have used "support-screen" attribute for this in AndroidManifest.xml file and uploaded the apk using advance mode on google play. Our settings for tablets and phones are as below:

For Phone:

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

And For Tablets:

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

We were partially successful in achieving this, but we faced problem in case of phablets like Sony Xperia D5322. It should show phone supporting apk, but it's showing tablet supporting apk.

Can you please suggest us the proper configuration settings so that phone supporting apk should appear only to mobile phones and phablets having large screens and resolution whereas tablet supporting apk should appear only to all types of tablets(i.e from 7" tablets to 10.1" tablets).

Note: We already tried Compatible-Screen option with following settings, but we didn't get what we wanted. So we decided to stick with support-screen option only.

For phone:

<compatible-screens>
        <screen android:screenSize="small" android:screenDensity="ldpi" />
        <screen android:screenSize="small" android:screenDensity="mdpi" />
        <screen android:screenSize="small" android:screenDensity="hdpi" />
        <screen android:screenSize="small" android:screenDensity="xhdpi" />

        <screen android:screenSize="normal" android:screenDensity="ldpi" />
        <screen android:screenSize="normal" android:screenDensity="mdpi" />
        <screen android:screenSize="normal" android:screenDensity="hdpi" />
        <screen android:screenSize="normal" android:screenDensity="xhdpi" />

        <!-- For devices like Nexus and Htc One-->
        <screen android:screenSize="large" android:screenDensity="xhdpi" />
    </compatible-screens>

For Tablet:

<compatible-screens>
    <!-- For 7 & 8 inch Tablets -->
    <screen android:screenSize="large" android:screenDensity="mdpi" />
    <screen android:screenSize="large" android:screenDensity="hdpi" />
    <!-- For 0 inch tablets -->
    <screen android:screenSize="xlarge" android:screenDensity="ldpi" />
    <screen android:screenSize="xlarge" android:screenDensity="mdpi" />
    <screen android:screenSize="xlarge" android:screenDensity="hdpi" />
    <screen android:screenSize="xlarge" android:screenDensity="xhdpi" />

    </compatible-screens>
Rachir
  • 49
  • 7
  • 1
    What you want is not possible, except perhaps by going in and manually checking/unchecking specific devices that you do/do not want to ship to. You cannot ship different APKs to arbitrary devices based upon arbitrary criteria. This is why Google, and most experts, advise that you have one APK that adapts to varying screen sizes. – CommonsWare Apr 09 '16 at 18:09
  • @commonsware: Thanks for the prompt reply. I don't want such settings for any specific device, I want such settings for specific range of devices. Like I want particular apk to be visible to only a set of devices. That is by above changes it satisfies most of the devices but few devices like mentioned above doesn't satisfy the criteria. So I just want to know is there any way by which I can include such phablet phones to satisfy the criteria in manifest file which satisfies normal phones. – Rachir Apr 09 '16 at 21:13
  • "So I just want to know is there any way by which I can include such phablet phones to satisfy the criteria in manifest file which satisfies normal phones" -- no, you cannot. – CommonsWare Apr 09 '16 at 21:31

1 Answers1

-2

It is impossible to deliver different APK's to different device sizes, however it is possible to have one APK and detect the screen size, then adjust accordingly. Check out this website or this website for more information on adjusting screen sizes.

Try to use the wrap_content and match_parent variables within your layouts and they should adjust the app according to the proportions of the device that it is installed on.

Hope this helps!

Cowboy433
  • 470
  • 1
  • 7
  • 20