即时应用的单独清单 [英] Separate manifest for instant app

查看:61
本文介绍了即时应用的单独清单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以对即时应用程序和常规应用程序使用不同的清单吗?
更详细地,我需要在"android:name=App"字段(应用程序标记)中指定不同的类"App".

Can I use different manifests for instant app and a regular application?
In more detail, I need to specify different classes "App" in the "android:name=App" field (application tag).

推荐答案

有几种方法可以做到这一点:

There are a few ways to do this:

如果必须具有两个不同的清单,则需要使用tools:replace,例如:

If you must have two different manifests, then you will need to use tools:replace, example:

您已安装的应用程序模块的清单:

Your installed-app module’s manifest:

<application
    android:name="com.example.App"
    tools:replace="android:name"/>

您的功能模块的清单:

<application
    android:name="com.example.feature.AppFeat">

构建已安装的应用程序时,它将与App一起运行;而构建即时应用程序的时候,它将与AppFeat一起运行.您可以玩各种游戏.

When your installed-app is built, it will run with App, and when your instant-app is built, it will run with AppFeat. You can play with variations of this.

但是,如果您使用

But it would be easier if you use isInstantApp() to branch off, in just one Application implementation.

这篇关于即时应用的单独清单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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