08-22-2008 12:19 PM - edited 08-22-2008 12:21 PM
Hi,
When trying to self delete our application by using following code,the application is not removed if we do Device.requestPowerOff(false) but the application is removed if we do CodeModuleManager.promptForResetIfRequired(). So PowerOff != Reset?
So my question is, is there a way to do a programtic reset that will remove our application? Or am I doing something wrong to do a self delete in our application?
This is happening on
8800
v4.2.1.7.4
Platform 2.3.0.5.4
Thanks for your time.
Jay
ApplicationDescriptor ad = ApplicationDescriptor.currentApplicationDescriptor
();
int moduleHandle = ad.getModuleHandle();
int rc = CodeModuleManager.deleteModuleEx(moduleHandle, true);
switch (rc)
{
case CodeModuleManager.CMM_OK_MODULE_MARKED_FOR_DELETION:
CodeModuleManager.promptForResetIfRequired();
//Device.requestPowerOff( false );
break;
case CodeModuleManager.CMM_OK:
//do something
break;
case CodeModuleManager.CMM_MODULE_IN_USE:
case CodeModuleManager.CMM_MODULE_IN_USE_BY_PERSISTENT_STORE:
//do something
break;
case CodeModuleManager.CMM_HANDLE_INVALID:
//do something
break;
case CodeModuleManager.CMM_MODULE_REQUIRED:
//do something
break;
default:
//do something
break;
}
Solved! Go to Solution.
08-25-2008 09:51 AM
You are correct, power off is not the same as reset. Power off suspends running applications and puts the BlackBerry in a "sleep" mode. When it is powered on applications resume from where they left off. This is the same as powering on/off a BlackBerry using the power button or red end key (varies based on model). The BlackBerry can power on almost instantly from this state.
A reset more closely resembles removing and reinserting the battery. This stops all applications and the JVM. When the BlackBerry restarts, the JVM restarts along with any auto-start applications. This process takes a few minutes.
If promptForResetIfRequired yields true, then it means the BlackBerry is unable cod files until the BlackBerry is restarted. The link below lists reasons why this may occur.
What Is - The reason a reset is required when upgrading an application
Article Number: DB-00602