Android - 如何创建我的应用程序的另一个版本?

时间:2020-12-11 07:11:00

I want to make a version of my app that is paid, and a version that is free.

我想制作一个付费的应用程序版本,以及一个免费的版本。

Right now one version is free. What should I do to the existing code base? Should I just copy paste everything? Or what is a good step by step approach I should take to a pain-free of copying over my app into a new app that will be modified?

现在一个版本是免费的。我该怎么做现有的代码库?我应该复制粘贴一切吗?或者什么是一步一步的好方法我应该轻松地将我的应用程序复制到一个将被修改的新应用程序中?

I really don't want to do it file by file. Is there a quick way to set up a new project and put the existing code base into it? And after that, what do I modify inside the new project?

我真的不想逐个文件地去做。有没有快速的方法来设置一个新项目并将现有的代码库放入其中?之后,我在新项目中修改了什么?

Thanks!

谢谢!

5 个解决方案

#1


2  

There is a work around to do this, you can copy your project into your work space using another name and then go to .project file and change the name tag to set the new project's name

有一个工作要做,你可以使用其他名称将项目复制到工作区,然后转到.project文件并更改名称标签以设置新项目的名称

 <name>New Project Name</name>

then all you have to do is import this project from eclipse, you can then make the necessary changes don't forget to make changes to your manifest file also.. but I should mention this is not the best practice to handle free/paid versions

那么你所要做的就是从eclipse导入这个项目,然后你可以进行必要的修改,不要忘记对你的清单文件进行更改..但是我应该提到这不是处理免费/付费版本的最佳做法

#2


2  

Well, if you want to implement your already existing code in another specialised application project , I think it is better to use your previous project as a library and reference it in your new project. That way, all the various classes in FreeApp would be accessible to you in your PaidApp. It can be considered analogous to Inheritance where the parent class can us used as a base class for the specialisations in the derived child class.

好吧,如果你想在另一个专门的应用程序项目中实现已经存在的代码,我认为最好将以前的项目用作库并在新项目中引用它。这样,您可以在PaidApp中访问FreeApp中的所有各种类。它可以被认为类似于继承,其中父类可以用作派生子类中的特化的基类。

To create a clone of your project : Open the project that you want to copy. Copy and Paste using Cntrl-C and Cntrl-V . When you finish pasting, Eclipse will ask you for a new project name. The Eclipse project name and directory are independent of the application name and package.

要创建项目的克隆:打开要复制的项目。使用Cntrl-C和Cntrl-V复制和粘贴。完成粘贴后,Eclipse会要求您提供新的项目名称。 Eclipse项目名称和目录独立于应用程序名称和包。

Have a look at this question for more details.

有关详细信息,请查看此问题。

#3


2  

What I've done is create a library project that has all the shared code and shared resources, and then multiple simple application projects that use the library.

我所做的是创建一个包含所有共享代码和共享资源的库项目,然后创建多个使用该库的简单应用程序项目。

Copy-paste is almost always a bad idea.

复制粘贴几乎总是一个坏主意。

See Android's Managing Projects documentation for more about library projects.

有关库项目的更多信息,请参阅Android的管理项目文档。

#4


2  

if you want that both apps could be installed in the same device, you should change the AndroidManifest.xml file so as the package name is different

如果您希望两个应用程序都可以安装在同一设备中,则应更改AndroidManifest.xml文件,以使包名称不同

So for the app1

所以对于app1

<manifest .... package="com.example.app1" .... />

And for the app2

对于app2

<manifest .... package="com.example.app2" .... />

obviously you have to rename the src/com/example/app1 and fix the namespaces of the java classes in that folder

显然你必须重命名src / com / example / app1并修复该文件夹中java类的名称空间

#5


1  

You could Export your free version, and then create a new project in eclipse. Import the free version into the existing space of this new project and make your necessary changes to your code there. You will have to re-sign this paid version with a different key/certificate though. This isn't exactly the most popular approach to managing paid/free models, the most common technique I've heard of is the In-App purchase, but I've yet to try this approach. Good luck

您可以导出您的免费版本,然后在eclipse中创建一个新项目。将免费版本导入到此新项目的现有空间中,并对您的代码进行必要的更改。您必须使用不同的密钥/证书重新签署此付费版本。这不是管理付费/免费模式最流行的方法,我听说最常见的技术是应用内购买,但我还没有尝试这种方法。祝你好运

#1


2  

There is a work around to do this, you can copy your project into your work space using another name and then go to .project file and change the name tag to set the new project's name

有一个工作要做,你可以使用其他名称将项目复制到工作区,然后转到.project文件并更改名称标签以设置新项目的名称

 <name>New Project Name</name>

then all you have to do is import this project from eclipse, you can then make the necessary changes don't forget to make changes to your manifest file also.. but I should mention this is not the best practice to handle free/paid versions

那么你所要做的就是从eclipse导入这个项目,然后你可以进行必要的修改,不要忘记对你的清单文件进行更改..但是我应该提到这不是处理免费/付费版本的最佳做法

#2


2  

Well, if you want to implement your already existing code in another specialised application project , I think it is better to use your previous project as a library and reference it in your new project. That way, all the various classes in FreeApp would be accessible to you in your PaidApp. It can be considered analogous to Inheritance where the parent class can us used as a base class for the specialisations in the derived child class.

好吧,如果你想在另一个专门的应用程序项目中实现已经存在的代码,我认为最好将以前的项目用作库并在新项目中引用它。这样,您可以在PaidApp中访问FreeApp中的所有各种类。它可以被认为类似于继承,其中父类可以用作派生子类中的特化的基类。

To create a clone of your project : Open the project that you want to copy. Copy and Paste using Cntrl-C and Cntrl-V . When you finish pasting, Eclipse will ask you for a new project name. The Eclipse project name and directory are independent of the application name and package.

要创建项目的克隆:打开要复制的项目。使用Cntrl-C和Cntrl-V复制和粘贴。完成粘贴后,Eclipse会要求您提供新的项目名称。 Eclipse项目名称和目录独立于应用程序名称和包。

Have a look at this question for more details.

有关详细信息,请查看此问题。

#3


2  

What I've done is create a library project that has all the shared code and shared resources, and then multiple simple application projects that use the library.

我所做的是创建一个包含所有共享代码和共享资源的库项目,然后创建多个使用该库的简单应用程序项目。

Copy-paste is almost always a bad idea.

复制粘贴几乎总是一个坏主意。

See Android's Managing Projects documentation for more about library projects.

有关库项目的更多信息,请参阅Android的管理项目文档。

#4


2  

if you want that both apps could be installed in the same device, you should change the AndroidManifest.xml file so as the package name is different

如果您希望两个应用程序都可以安装在同一设备中,则应更改AndroidManifest.xml文件,以使包名称不同

So for the app1

所以对于app1

<manifest .... package="com.example.app1" .... />

And for the app2

对于app2

<manifest .... package="com.example.app2" .... />

obviously you have to rename the src/com/example/app1 and fix the namespaces of the java classes in that folder

显然你必须重命名src / com / example / app1并修复该文件夹中java类的名称空间

#5


1  

You could Export your free version, and then create a new project in eclipse. Import the free version into the existing space of this new project and make your necessary changes to your code there. You will have to re-sign this paid version with a different key/certificate though. This isn't exactly the most popular approach to managing paid/free models, the most common technique I've heard of is the In-App purchase, but I've yet to try this approach. Good luck

您可以导出您的免费版本,然后在eclipse中创建一个新项目。将免费版本导入到此新项目的现有空间中,并对您的代码进行必要的更改。您必须使用不同的密钥/证书重新签署此付费版本。这不是管理付费/免费模式最流行的方法,我听说最常见的技术是应用内购买,但我还没有尝试这种方法。祝你好运