对安卓电视和手机的多个 apk 支持 [英] Multiple apk support for Android TV and Phone

查看:68
本文介绍了对安卓电视和手机的多个 apk 支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在市场上有一个具有 minSDK 版本 9 的应用程序,并且我还开发了该应用程序的 Android TV 版本具有相同的包名称,但 API 级别重叠.

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.

所以,我的问题是;如何上传 2 个具有相同包名的不同 APK(电视和手机/平板电脑)?Android TV 的 APK 只能看到电视和 Nexus Player 等.其他 APK 只能看到同时使用手机和平板电脑.

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.

我确实阅读了有关多种 APK 支持的所有文档,但是当我通过当前可用的应用上传适用于 Android TV 的 APK 时,旧版本对于手机和平板电脑不可用(不兼容).

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.

在我的情况下不接受具有不同包名称的两个不同的 APK.

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

我必须有一个包名,两个不同的 APK,并且都必须可用于他们的兼容设备.

在我的电视应用清单中,使用了这些功能;

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.

推荐答案

解决方案是切换高级模式并正确使用 minSDK 版本.

The solution is switching advanced mode and and using minSDK version properly.

您最新的 APK 应具有最高的 minSDK 版本.

Your latest APK should have highest minSDK version.

例如,如果您有2个不同平台的apk,并且它们的minSDK版本不同,请先上传minSDK版本较低的APK.然后,上传更高的.

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.

现在我有 3 个 APK 正在生产中.一切正常.

Now I have 3 APKs in production. All are working fine.

这篇关于对安卓电视和手机的多个 apk 支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆