Up to Android 5.0 there was option for detecting app uninstall is using native code:
You need to monitor for Your directory using inotify
framework in forked process.
When it's deleted You can run some system command eg. am
command that starts Intent
PoC of such solution: https://github.com/pelotasplus/ActionAfterUninstall/blob/master/app/src/main/jni/hello-jni.c