如何在市场上发布应用程序的两个版本?
我想将我的应用程序的两个版本添加到 Android 市场,一种只需几美分,另一种是带广告的免费版本。这是一种非常常见的做法。
我目前正在将 AdMod 构建到我的应用程序中,看来我必须更改相当多的文件,因此最好为此制作一个单独的应用程序版本。
你如何实现这一目标?一个分支机构?不同的存储库?有没有人找到一种方法以合理的方式将两个应用程序保存在同一个存储库中?
标题没有拼写错误,我的意思是“实现”,即人们如何管理这两个版本,而不是他们如何将它们添加到市场。
I would like to add two versions of my app to the Android Market, one for a few cents, and one free version, with ads. That's a very common practice.
I'm currently building AdMod into my app, and it seems I'll have to change quite a few files, so it seems best to make a separate version of my app for this.
How do you achieve that? A branch? A different repository? Has anyone found a way to keep both apps in the same repository in a reasonable manner?
The title is not misspelled, I do mean "realise", i.e. how people manage the two versions, not how they add them to the Market.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这种事情完全是一场噩梦——不幸的是 Android 构建系统并没有真正以任何好的方式支持它。
我们通过将应用程序 99% 的代码放在库项目中来实现这一点。然后,我们为应用程序的每个不同版本创建一个应用程序项目,每个版本都使用该库。
当我们需要不同版本的应用程序有不同的行为时,我们目前通过在运行时查询不同的资源来实现这一点。然而,我们正在转向通过 RoboGuice 使用依赖注入。
其中有些元素工作得相当好,而另一些则不然。例如,有必要复制 AndroidManifest.xml 文件,这可能容易出错(例如,很容易将新活动添加到一个清单中,而忘记在其他清单中执行此操作)。不幸的是,这是一团糟,但这是我们找到的最不糟糕的解决方案。
就我个人而言,我强烈建议不要使用分支来实现这种效果。它们最初可以很好地工作,但很快就会成为维护的噩梦。
使用库的另一个好处是我们发现它使测试变得更加容易。有关如何设置的示例,请参阅:
http://www.paulbutcher.com/2010/09/android-library-project-with-tests-step-by-step/
This kind of thing is a complete nightmare - unfortunately the Android build system doesn't really support it in any good way.
We do it by having 99% of the code of our application in a library project. We then create one application project for each different version of the app, each of which use that library.
Where we need different versions of the app to behave differently, we currently achieve that by having different resources that are queried at runtime. We are in the process of moving to using Dependency Injection via RoboGuice, however.
There are elements of this that work reasonably well, and others that don't. It's necessary, for example, to duplicate the AndroidManifest.xml file, which can be error-prone (it's easy, for example, to add a new activity to one manifest and forget to do so in the others). It's a mess, unfortunately, but the least-bad solution we've found.
Personally speaking, I would strongly advise against using branches to achieve this effect. They can work well initially, but will rapidly become a maintenance nightmare.
One side benefit of using a library is that we've found that it makes testing considerably easier. For an example of how to set this up, see:
http://www.paulbutcher.com/2010/09/android-library-project-with-tests-step-by-step/
人们通常会上传两次(就像两个不同的程序),然后只是修改标题以添加诸如“无广告”、“捐赠”之类的内容。在免费版本上,只需添加“免费”标签,并添加“支持广告”的说明。
以下是 SMS 弹出应用程序的示例:
对于 Android Market,它们被视为不同的程序,但对于我们来说是相同的,但其中一个是广告支持的另一个不是。
People usually upload them twice(like two different programs) and just modify the title for adding something like Ad-Free, Donate and things like that. And on the free version just add the Free label and also put on the description that it's Ad-Supported.
Here is an example with the SMS Popup application:
For the Android Market, they are considered different programs, but for us it's the same, but one is Ad-Supported and the other isn't.