Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple apk support for Android TV and Phone

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.

like image 898
Oğuzhan Döngül Avatar asked Dec 21 '15 09:12

Oğuzhan Döngül


People also ask

Can APK files run on Android TV?

Install APKs from an Android phone or tablet First, you'll need to install the "Send files to TV" app from the Play Store on both your phone and TV. To install it on your TV, open the Play Store and search for the name, or click the above link on a desktop computer and set your TV as the installation target.

Can I install mobile APK on TV?

So it's better to download the APK files on your Android phone or computer and then transfer them to your Android TV. One of the easiest ways to achieve this is by using the Send Files to TV (SFTTV) app. It's available on the Google Play store for both Android phones and Android TVs.


1 Answers

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.

like image 148
Oğuzhan Döngül Avatar answered Oct 11 '22 05:10

Oğuzhan Döngül