简体   繁体   中英

Android - how do I create another version of my app?

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!

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

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.

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM