Multiple APK support for phone and tablet android

2019-08-20 06:36发布

问题:

I have 2 APKs with same package name. I want to upload 1 apk to support for android phone only(min sdk version 8) and different apk to support for tablet only(min sdk version 11).

for phone I have declared below code in manifest:

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

And for tablet:

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

My package name is same for both app so that I can upload multiple apk. But some of the devices are of large screen, so there devices fall in both above category. So how to consider those devices as phone and allow him to download phone version and not tablet version? Or should I have to change anything in manifest file?

回答1:

You should support multiple screens in a single APK.

In your case, you can create layout-large and layout-xlarge.

Here you can read about: http://developer.android.com/guide/practices/screens_support.html

But, if you really want to publish two apks, here is the guide: http://developer.android.com/google/play/publishing/multiple-apks.html