I have a broadcast receiver registered programatically in a activity. It responds to the PACKAGE_REMOVED intent, that fires when a package gets removed.
PACKAGE_REMOVED
Maybe you can register the receiver in service which will run background