Tuesday, June 2, 2015

duplicate an android project

1) In eclipse, copy the original whole project and paste in eclipse ( Not copy the project folder in windows explore), eclipse will ask you for a new project name, just type in the new project name.

2)(optional, because eclipse already done for you) go into manifest and change the name there. Be sure and make the change in the "manifest" tab NOT in the xml code . and hit save icon , a pop-up will ask if you want to "update your Launch Configurations", hit "YES"

3)Click on "SRC" at the top of the package. Notice how the package name under the src folder has not changed names. right click that and select refactor>, Change the name. ... a rename menu appears, all the boxes should be checked and hit "preview" (you might get a warning it already exists...go on anyway) that should then change the package names in the individual class files. 

4) change app name , should change value of "app_title" at res->values->demo_strings.xml



=============================================================

http://stackoverflow.com/questions/5170425/quickest-way-to-duplicate-an-android-project



Here's the procedure I've been using for making a new copy of a project. It's worked fone for a large project I wanted to break down to a smaller more specialized and I also have a scene manager template that I clone from for the start of each new project. All these steps seem to work fine and it's done within Eclipse/ADT
how to clone a project and rename it. ------------------------------ open up the source project, (ie just click on it. name of project and leave it highlighted) then control-c control-v , give it a new name..note this is a TEMP name because you will have to rechange it in a second so "the copy" is just fine.
The copy should paste in place, open up the copy ,right click on top line and select "refactor--> rename--> give the new name you want to name the whole project and check "update references" if it's not already checked.
Then go into manifest and change the name there. Be sure and make the change in the "manifest" tab NOT in the xml code . and hit save icon , a pop-up will ask if you want to "update your Launch Configurations", hit "YES"
Click on "SRC" at the top of the package. Notice how the package name under the src folder has not changed names. right click that and select refactor>, Change the name. ... a rename menu appears, all the boxes should be checked and hit "preview" (you might get a warning it already exists...go on anyway) that should then change the package names in the individual class files. Open a few and check the top line for the package is updated. under res/values is a file strings.xml. Open it you should see this. XXXXXXXX
and change the XXXXXXX part to the new name you want for your icon on the device/emulator, probably the Apps name that's it. It was such a pain to do this each time so I created my own "doc" to help. I've double checked this a few time

No comments: