Original Author Paul Laughton, 2011
Page 221
De Re BASIC!
9.
Make sure the Update references box is checked and click OK.
Your project is ready to build. Restore the automatic build feature of Eclipse:
10.
Click Project->Build Automatically. Make sure the checkmark appears.
The project should build without errors.
Other IDEs
Most changes in this Appendix are simply changes in source files, and so they apply to any IDE. Editing
the package name is a more complex. Eclipse hides some of the complexity, but it also requires special
actions when renaming the package so the IDE knows about the change. A different IDE, it may have its
own requirements.
This section will describe all of the changes necessary to rename the package. Your IDE may do them, or
you may have to do them yourself with a text editor. Some editors can do global search-and-replace
across an entire file tree, which can save you a lot of work.
1.
The package name is also a path name. If all of your source files are in a directory called "src",
and your package name is "
com.rfo.basic
", then your source files are really in a directory
called
src/com/rfo/basic
. If you change the package, for example, to "
com.rfo.cats
", then
you must also move all of the source files to the new directory, in this case
src/com/rfo/cats
.
2.
Everywhere it occurs, the string "
com.rfo.basic
" must be changed to your new package name.
a.
The Android manifest file (
AndroidManifest.xml
) contains the line
package
=
"com.rfo.basic"
If you have a
bin
directory in your project, it may contain a copy of the manifest file. It
was generated by the Eclipse build process. You may ignore it or delete it.
b.
Two layout files,
res/layout/editor.xml
and
res/layout/console.xml
, contain
class
attributes:
class
=
"com.rfo.basic.Editor$LinedEditText"
class
=
"com.rfo.basic.Run$ConsoleListView"
c.
Every
.java
file in the source directory (
*.java
) contains the line
package
com.rfo.basic;