Original Author Paul Laughton, 2011
Page 222
De Re BASIC!
d.
Several
.java
files (currently 7) files contain a line that starts like one of these:
import
com.rfo.basic.
import static
com.rfo.basic.
Some files have more than one such line.
e.
Two files,
Editor.java
and
LauncherShortcuts.java
, contain one of these strings:
public static final String
EXTRA_LS_FILENAME = "com.rfo.basic.fn";
public static final String
EXTRA_LS_FILENAME = "com.rfo.basic.doRestart";
You may safely ignore these, since they are not used in a standalone APK. However, it
does not hurt to change these instances of
com.rfo.basic
along with all the others.
Renaming complete
At this point the package has been successfully renamed. Next we will create a practice APK that you
then use to make your own APK.
Modifications to setup.xml
You can customize your apk with settings in the resource file setup.xml. Some changes are required for
any apk.
In the Package Explorer, expand Cats/res/values and then double-click setup.xml. The file opens in the
window on the right. There are tabs at the bottom of the window that let you change how the file is
displayed. If the Resources tab is selected, you see a special Eclipse Resource Editor. This editor does not
know how to modify all of the properties in this file. Click on the setup.xml tab to display the actual XML
text, as shown in the image below. In this view, you can also see the comments describing the values
you can change for your application.
Be sure you change only values, not names. Names are shown as blue text in quotes. Values are shown
as black text with no quotation marks. If you change a name, Java can not find the item to get its value.
Change the value of "app_name" from BASIC! to Cats!. This is the name of the application as it will
appear on your Android device.
Change the value of "app_path" to rfo-cats. This will be the directory on the SD card where your files
are stored, if you choose to have a directory for files for your application. Make this change even if you
do not choose to create directories for your application. It has implications in other parts of the code.
Change the value of "is_apk" to true.
The items "apk_create_data_dir" and "apk_create_database_dir" are flags that control whether
directories are created under "app_path" for your application's files. Since this practice application does
not need any directories, change the values of both to false.
The item "load_file_names" is a list of files that you want loaded to the SD card. This practice
application uses the sound clip meow.wav. Running under standard BASIC!, the program would use the
file rfo-basic/data/meow.wav. As a standalone application, it can use a file image built into APK. Since
the practice application is not using a real file, you can leave the "load_file_names" list empty.