Here I wanted to create an app based on the second tutorial that comes with OpenCV (see more here). So, I wanted to copy that and start working on it. This is what I did:
- Ctrl+C, Ctrl+V on the project that you want to copy (make sure the project is open)
- Enter new project name when prompted.
- Change the package name on the AndroidManifes.xml to whatever you want it to be. Click save.
- On the "Do you want to update your launch configurations?" say "yes".
- Right click on the package name, within src folder, and select refactor-rename. Enter new name. If you click in Preview it may show you a warning (package already exists in gen folder...). I ignored it (continue).
- Change the name of the application in the AndroidManifest. The real name may actually be in the strings.xml, so change it there too...
- Right click on the class name, inside the package, and select refactor-rename. Change main class name. It will update also any reference to it inside the code.
- Note: you may get an error on the link to native library. Just click continue and fix it later... Hint: the easiest way to fix errors is clicking on them and picking from the options they give you.
- Now if you click Run, select Android Application, should work...
Update 1: I did similar thing now for a C project I was using in ODE. Steps 1 and 2 are the same. Then in properties-Run/Debug settings delete the old launch configuration and enter a new one for the new project.
Update 2: After I copy the ODE project (ctrl+C, ctrl+V, rename the cpp) the whole file is marked with red warnings/errors. It is solved by going to properties --> C/C++ General --> Indexer and then mark Enable project specific settings, Enable indexer, Use active build configuration.
Cheers!
No comments:
Post a Comment