| | 238 | ====== Names ====== |
| | 239 | There are actually two names - the project/application name and the unique application name. |
| | 240 | |
| | 241 | For the example project, they project name is {{{PySideExample}}} and the unique name is {{{org.modrana.PySideExample}}}. As you can see, the project name is also a suffix for the unique name. (You probably can use a project name that differs from the suffix, but I rather make them the same to avoid needless confusion). |
| | 242 | |
| | 243 | The unique name is very important: |
| | 244 | * it has to be unique so it dosn't clash with other applications |
| | 245 | * for this reason, it is mostly based on a domain name you control or some other string with low possibility of being used by another developer |
| | 246 | * the unique name is used for path to the installation folder |
| | 247 | * the example project uses the {{{org.modrana.PySideExample}}} and it is installed into {{{/data/data/org.modrana.PySideExample}}} as a result |
| | 248 | * the path to the installation folder is used when setting important environmental variables, so make sure to change all the corresponding paths when changing the unique name |
| | 249 | |
| | 250 | |
| | 251 | ====== What to rename and where ====== |
| | 252 | Lets say we want to rename the example project from {{{PySideExample}}} to {{{BarApp}}} and from {{{org.modrana.PySideExample}}} to {{{foo.foomatic.BarApp}}} |
| | 253 | |
| | 254 | * rename the project file: |
| | 255 | {{{ |
| | 256 | mv PySideExample.pro BarApp.pro |
| | 257 | }}} |
| | 258 | |
| | 259 | * replace the name inside the project file: |
| | 260 | {{{ |
| | 261 | sed -i "s/PySideExample/BarApp/g" BarApp.pro |
| | 262 | }}} |
| | 263 | |
| | 264 | * replace all unique names in {{{main.h}}}: |
| | 265 | {{{ |
| | 266 | sed -i "s/org.modrana.PySideExample/foo.foomatic.BarApp/g" main.h |
| | 267 | }}} |
| | 268 | |
| | 269 | * replace all unique names in the {{{QtActivity}}}: |
| | 270 | {{{ |
| | 271 | sed -i "s/org.modrana.PySideExample/foo.foomatic.BarApp/g" android/src/org/kde/necessitas/origo/QtActivity.java |
| | 272 | }}} |
| | 273 | |
| | 274 | * replace all names in the Android manifest file: |
| | 275 | {{{ |
| | 276 | sed -i "s/org.modrana.PySideExample/foo.foomatic.BarApp/g" android/AndroidManifest.xml |
| | 277 | sed -i "s/PySideExample/BarApp/g" android/AndroidManifest.xml |
| | 278 | }}} |
| | 279 | |
| | 280 | * and the last is in the {{{android/res/strings.xml}}} and {{{android/build.xml}}} file: |
| | 281 | {{{ |
| | 282 | sed -i "s/PySideExample/BarApp/g" android/res/values/strings.xml |
| | 283 | sed -i "s/PySideExample/BarApp/g" android/build.xml |
| | 284 | }}} |
| | 285 | |
| | 286 | |
| | 287 | To verify that you have really changed all of the original names or if there are still some left, you can use this command: |
| | 288 | |
| | 289 | {{{ |
| | 290 | find . -type f -print0 | xargs -0 file | grep -P text | cut -d: -f1 | xargs grep "PySideExample" |
| | 291 | }}} |
| | 292 | |
| | 293 | |