我认为你正在寻找的是一个图书馆项目 http://developer.android.com/guide/developing/projects/index.html#LibraryProjects
从该网页:
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.
另一个问题,与这个问题非常相似,似乎有一个不错的讨论和答案:具有共享代码库的多个应用程序。
编辑:这是有关如何实现库项目的链接。http://developer.android.com/guide/developing/projects/projects-eclipse.html
对于不同的版本略有不同,库项目可以容纳。首先生成库项目,然后最后生成父项目(使用库的项目),并将它们合并在一起。两个项目都可以定义相同的资源标识符,最后构建的项目(父项目)将获得优先级(覆盖)。因此,从本质上讲,您可以在父/调用应用程序中覆盖字符串/布局(可能更多,不确定?)。
例如:假设您有两个项目,免费和付费。您可以使用默认实现(免费版本)创建一个字符串,并在付费版本(父应用)中覆盖它。
共享库中的代码 字符串.xml文件:
<string name="AppName">My Application (Free)</string>
父应用字符串.xml文件中的代码:
<string name="AppName">My Application Premium</string>