Perform the specified command.
The operation is specified in the initialCommand field of the
command state. The nextCommand state will be set to next command or
EXIT. The status will also be set.
The command state also contains the arguments needed a command.
Command Argument(s)
----------- -----------
install suiteURL
remove suiteStorageName
run suiteStorageName and optionally (midletName and runOnce)
install-run suiteURL and optionally (midletName, autotest, and runOnce)
The list
command displays a list of the currently
installed applications.
The install
command will install the given application.
The URL used for installation must point to a valid application
descriptor file. Only HTTP URLs are accepted. If any errors were
encountered during installtion, the status will be ERROR or
MIDLET_SUITE_NOT_FOUND. if forceOverwrite in the command state is
set MIDlet suite will be forcibly installed. See
Installer.installJad() for a description.
The remove
command will remove the given application
suite or storage used when running single class of local descriptor.
If you specify the special keywork all
as the
suite name, all application suites will be removed.
The run
command will execute the given MIDlet from
a suite, or if not MIDlet is given, let the user select one.
If runOnce in the command state is the next command will be
remove.
The install-run
command performs the install
and then the run
command. If autotest and runOnce are
set in the command state, then after removing the suite the next
command will be install. The autotest cycle is broken when the
suite at the URL is not found.
String nextMidletSuiteToRun;
// don't run twice, a sneaky untrusted MIDlet may try this
if (performing) {
return;
}
performing = true;
// we need to get the installer now, before the security level drops
if (installer == null) {
installer = Installer.getInstaller();
}
dispatch(state);
nextMidletSuiteToRun = installer.getNextMIDletSuiteToRun();
if (nextMidletSuiteToRun != null) {
state.nextCommand = RUN;
state.suiteStorageName = nextMidletSuiteToRun;
// the run method should clear this
state.midletName = installer.getNextMIDletToRun();
}
performing = false;