多个APK支持Android TV和Phone [英] Multiple apk support for Android TV and Phone

查看:172
本文介绍了多个APK支持Android TV和Phone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在市场上有一个具有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.

所以,我的问题是; 我如何上传两个具有相同程序包名称的不同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支持的所有文档,但是当我通过当前可用的应用程序将APK for Android TV上传到Android TV时,旧版本无法用于手机和平板电脑(不兼容).

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支持Android TV和Phone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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