Reputation: 18629
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!
Upvotes: 1
Views: 236
Reputation:
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
So for the app1
<manifest .... package="com.example.app1" .... />
And for the 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
Upvotes: 2
Reputation: 82535
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.
Upvotes: 2
Reputation: 16354
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.
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.
Have a look at this question for more details.
Upvotes: 2
Reputation: 4816
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
Upvotes: 1
Reputation: 6849
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
<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
Upvotes: 2