Support multiple apk for Android TV and phone

I have one application on the market that has minSDK version 9, and I also developed a version of this application with Android TV support with the same package name , but the API levels overlap.

So my question is: How can I download 2 different apk (TV and phone / tablet) with the same name? The APK for Android TV should only be shown with TV and Nexus Player, etc. Another Apk should only be seen for phones and tablets at the same time.

I read all the support documents for several APKs, but when I downloaded the Android TV APK on top of my currently available application, the older version became inaccessible (incompatible) for phones and tablets.

Two different APKs with different package names are not acceptable in my case.

I must have one package name, two different APKs, both must be available for their compatible devices.

The manifest of my TV applications 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 application does not use the function, it has the usual 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 moment? I need a clear explanation or solution.

+5
source share
2 answers

The solution switches the advanced mode and correctly uses the minSDK version.

Your latest APK should have the highest version of minSDK.

For example, if you have 2 apk for different platforms, and their minSDK versions are different, first download the APK, which has a lower version of minSDK. Then load a higher one.

Now I have 3 APKs in production. Everything is working fine.

0
source

You need to make sure that the version code for both of your apks (TV and mobile / tablets) is not the same. Also let us know what worked for you (if you have already figured this out).

+1
source

Source: https://habr.com/ru/post/1238817/


All Articles