gpt4 book ai didi

android - 如何保留同一个安卓应用的两个版本?

转载 作者:太空狗 更新时间:2023-10-29 15:36:58 27 4
gpt4 key购买 nike

我们经常看到 Android 应用的两个版本:付费版和免费版。我也在开发一个应用程序,它想发布两个版本。做这个的最好方式是什么?在我看来,创建两个项目并在其间复制文件似乎不是最佳方式。

最佳答案

使用Library Project ,正如官方开发指南所建议的那样:

If you have source code and resources that are common to multiple Android projects, you can move them to a library project so that it is easier to maintain across applications and versions. Here are some common scenarios in which you could make use of library projects:

  • If you are developing multiple related applications that use some of the same components, you move the redundant components out of their respective application projects and create a single, reuseable set of the same components in a library project.

  • If you are creating an application that exists in both free and paid versions. You move the part of the application that is common to both versions into a library project. The two dependent projects, with their different package names, will reference the library project and provide only the difference between the two application versions.

关于android - 如何保留同一个安卓应用的两个版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11075699/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com