问题
I have a single application in market which has minSDK version 9, and I have also developed a Android TV version of this application with same package name, but API levels are overlapping.
So, my question is; how can I upload 2 different apk's (TV & Phone/Tablet) with same package name? The APK for the Android TV should be seen only TV's and Nexus Player etc. Other Apk must be seen for only phones and tablets at the same time.
I did read all documentations about multiple APK support but when I uploaded the APK for Android TV over my currently available app, older version became unavailable(not compatible) for phones and tablets.
Two different APKs with different package names not acceptable in my case.
I must have single package name, two different APKs, both must be available for theirs compatible devices.
In my TV apps manifest, used these features;
<uses-feature
android:name="android.hardware.microphone"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-feature
android:name="android.software.leanback"
android:required="true" />
<activity
android:name="com.mydomain.android.ui.ActivityYYY"
android:icon="@drawable/my_banner"
android:label="@string/app_name"
android:logo="@drawable/my_tv_banner"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
My Phone/Tablet app is not using feature, has normal Launcher as you see below
<activity
android:name="com.mydomain.android.ActivityXXX"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
What should I do? What did I miss at this point? I need a clear explanation or a solution.
回答1:
You need to ensure that version code for both of your apks (TV and mobile/tablet) are not the same. Also let us know, what worked for you (in case you already figured it out).
回答2:
The solution is switching advanced mode and and using minSDK version properly.
Your latest APK should have highest minSDK version.
For example, if you have 2 apk for different platforms and their minSDK versions are different, first upload the APK which has lower minSDK version. Then, upload the higher one.
Now I have 3 APKs in production. All are working fine.
来源:https://stackoverflow.com/questions/34392781/multiple-apk-support-for-android-tv-and-phone