与共享code的基础多个应用程序 [英] Multiple Apps with a shared code base

查看:106
本文介绍了与共享code的基础多个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于它的流行同时拥有自由,并在相同的应用程序的Andr​​oid Market的付费版本,我已经决定这样做。起初我只是复制了完整的codeBase的和在这里和那里适应一些code(加广告,内置了一些限制等),因为没有选择在那个时候做的库项目,但给我留下了两个项目这是可怕的管理修补程序的错误,因为我需要做那些两次。

由于R14,我们可以使用库项目的资源,所以这将是一个很好的解决方案,以这种特殊的问题,因为据我可以告诉。因此,我已经在库项目并conciderations读了,我很好奇,知道需要在不同版本的项目文件的最小量是。因此,我的问题是;

  • 我可以让所有的code。在共享的项目,并有裸骨项目,基本上只是一个清单?
    • 如果是这样,要这样呢?这是概念上的最佳方法是什么? (因此除了它取决于我的code碱基的事实)
  • 我应该如何处理库包的命名,有没有具体规定?
  • 是否有工具有关,可以从两个不同的项目比较code,也许它们合并自动神奇地或自动手动,和哪一个是preferred?
解决方案
  1. 是的,你可以有一个项目,基本上是一个明显的指定应用程序的名称,命名空间,图标等,所有的实际code和99%,在库项目的资源。

  2. 是的,我认为你应该使用这种方法。这是非常普遍使用的库项目来应对的免费/付费应用程序的问题。

  3. 我已经没有用命名的任何问题,不过你要小心,在不同的项目中的所有资源,以避免使用相同的名称。

  4. 我不知道任何工具,如果是我的话我愿意做手工,以确保我在合并哪些需要合并,并保持独立的哪些地方可以分开的。你已经1显著重构做,但一旦所有的复制被删除我敢肯定,这会容易得多。

Since it's popular to have both a free and a paid version in the android market of the same app, I had decided to do the same. Initially I just duplicated the complete codebase and adapted some code here and there (added ads, built in some limitations etc) since there was no option to do library projects at that time, but that left me with two projects that are horrific to manage fixes to bugs as I need to do those twice.

Since r14 we can use library projects with resources, so that would be a great solution to this particular problem as far as I can tell. Therefore I've read up on library projects and conciderations, and I'm curious to know what the minimum amount of files needed in the projects of the different versions are. My questions therefore are;

  • Could I have all of the code in the shared project, and have bare bone project with basically just a manifest?
    • If so, should I? is this the optimal way conceptually? (so apart from the fact that it depends on my code base)
  • How should I deal with library package naming, are there specific rules?
  • Are there tools about that can compare code from two different projects and perhaps merge them auto-magically or auto-manually, and which one is preferred?

解决方案

  1. Yes, you can have a project that is basically just a manifest specifying app name, name space, icon etc, with all the actual code and 99% of the resources in the library project.

  2. Yes, I think you should use this approach. It's very common to use library projects to deal with the Free/Paid app problem.

  3. I've not had any problems with naming, though you should be careful with any resources in separate projects to avoid using the same names.

  4. I'm not aware of any tools, and if it were me I'd want to do it manually to be sure I'm merging what needs merging and keeping separate what needs to be separate. you've one significant refactor to do, but once all the duplication is removed I'm sure it'll be much easier.

这篇关于与共享code的基础多个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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