Is it possible to detect Android app uninstall?

后端 未结 7 960
清酒与你
清酒与你 2020-11-22 11:18

My app is using Google\'s C2DM (push notification) to notify users about new activity from friends. Once they install the app I register the device with C2DM servers and sto

7条回答
  •  借酒劲吻你
    2020-11-22 11:53

    Yes, but it is quite hacky. The method is based on the fact that the first thing android does when uninstalling your app is deleting your data file. So you could use a file watcher to detect the deletion. Also you need to write this in native code. If you write your code in java, your app will be uninstalled before it could execute any code. please see this demo : https://github.com/sevenler/Uninstall_Statics

提交回复
热议问题