Android应用的批量出版批量、Android

2023-09-12 09:11:45 作者:为你心软

我们有几个应用程序,将在布局和code非常相似。唯一的区别是,我们将切换出图形元素,并进行更改单个常量文件和字符串文件。当然,那里有几个问题,这个 - 第一个是命名空间。具有相同的命名空间将覆盖任何其他应用程序的应用程序。

We have several apps that will be very similar in layout and code. The only difference is we will be switching out graphical elements, and making changes to a single constants file and strings file. Of course, theres several problems with this -- the first being namespace. Having an app with the same namespace will overwrite any other apps.

什么是一些建议,这样做呢? 目前,我们的namesapce是: com.company.appname 我想我可以这样做: com.company.appname.appversion

What are some suggestions to doing this? Currently our namesapce is: com.company.appname I figured I could do: com.company.appname.appversion

我已经看到了张贴关于ant脚本,有了这种帮助,但如果theres现在更流畅的解决方案。

I've seen post about ant scripts that helps with this, but I'm wondering if theres more fluid solutions now.

推荐答案

我会建议寻找到的 Android的库项目,以帮助这个。

I would suggest looking into Android Library Projects to help with this.

我用这种方式为我的应用程序之一的精简版与免费edtions。我有一个包含所有的源和大多数的应用程序的资源,并使用1号作为一个库项目,一个是精简版,一个是完整版的,然后2项目库项目。

I use this approach for a Lite vs. Free edtions of one of my apps. I have a Library project that contains all of the source and most of the resources for the apps and then 2 projects that use the 1st as a library project, one for Lite and one for Full edition.

这两个相关的项目,每个人都有自己的资源和清单,允许命名空间是不同的,对我来说,在不同的字符串,可绘等交换取决于版本。

The two dependent projects each have their own resources and manifest, allowing the namespace to be different and for me to swap in different strings, drawables, etc. depending on the edition.

我尝试了蚂蚁的方式,但它似乎更麻烦比库项目方法。希望有所帮助。

I tried the Ant approach but it seemed to be much more of a hassle than the Library project approach. Hope that helps.