Possible if you modify kernel
. All files created in the data/data/your.app.package is deleted automatically upon install.
Another approach could be to have another application that checks whether this application is installed or not. If not, it can do the clean-up work.
UPDATE
The ACTION_PACKAGE_REMOVED intent will be sent out to all receivers except for your own. This is confirmed HERE.
UPDATE 2
Just Another thought.
as I searched for this on I found that, this can be done by monitoring logcat for your application
here is a sample logcat monitor
Good thing is that to monitor logcat for same application we need not have a rooted device
and as we read each entry in logcat we can search for following string
Received broadcast Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:com.package.name flg=0x8000010 (has extras) }
as this event is received we know that our app is now going to be un installed
Did not try though
Again monitoring logcat is not allowed from Android Jellybean