Detect the uninstall event inside the application
Following information is correct for shutting down of system, not for uninstalling. I found some pointers which suggest that there is no way that we can get uninstall event. I also tried following code, but didn't get any event.
It is possible to find the uninstall or abnormal exit of an application from inside your application if you are using the Symbian application framework. You have to override the CCoeAppUi::HandleSystemEventL(const TWsEvent &aEvent) to your AppUi class. Whenever a system event is generated, this function will get invoked. The paramerter aEvent will give you more information. Now check the following code, which is used to detect the uninstall event of an application.
void CMyAppUi::HandleSystemEventL(const TWsEvent& aEvent)
TApaSystemEvent systemEvent = *(TApaSystemEvent*)aEvent.EventData();
// TODO: Do what ever is necessary here.
// An example would be authenticate the user.
// and if the authentication got succeed call