是否有可能发现Android应用程序卸载? [英] Is it possible to detect Android application uninstall?

查看:142
本文介绍了是否有可能发现Android应用程序卸载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何用谁早前已安装他/她的设备上的应用程序用户卸载应用程序之前启动一个活动,服务和广播接收器?

How to start an Activity ,Service or broadcast receiver before an application uninstalled by the user who has earlier installed the app on his/her device?

如果可能,请帮助我?并在此先感谢

If possible please help me? and thanks in advance

推荐答案

没有亲爱的,你不能检查您的应用程序要卸载。

No dear you cant check that your application is going to uninstall.

当用户卸载应用程序,起初进程被终止,那么你的apk文件和数据目录被删除,在包管理器中的记录,告诉其意图过滤你已经注册以及其他应用。

When the user uninstalls the app, at first the process is killed, then your apk file and data directory are deleted, along with the records in Package Manager that tell other apps which intent filters you've registered for.

但你可以在你的缓存目录创建文件夹,这样,当你的应用程序将被删除所有文件夹和文件将自动被删除。

But you can create your folder in your cache dir so that when your application will be deleted all folders and files automatically will be deleted.

请检查一下。 http://developer.android.com/guide/topics/data/data -storage.html

因此​​,有没有办法让你的应用程序知道它正在卸载(不修改内核)。在数据/数据​​/ your.app.package创建的所有文件被卸载时自动删除。

So there's no way for your application to know that it is being uninstalled (without modifying the kernel). All files created in the data/data/your.app.package is deleted automatically upon uninstall.

另一种方法可能是有另一个应用程序,它会检查这个应用程序是否安装或没有。如果不是,它可以做清理工作。

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.

像<一个href=\"https://hackfindings.word$p$pss.com/2014/03/06/android-how-to-find-if-a-user-has-uninstalled-the-application/\"相对=nofollow>这个

这篇关于是否有可能发现Android应用程序卸载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆