钩一些规律性的任务是什么? [英] Hook some regular tasks?

查看:137
本文介绍了钩一些规律性的任务是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道是否以下是可能的:

I'm wondering if the following is possible:

我已经是停留在背景,而被触发一个应用程序(服务)每当用户

I've an app (service) that stays in background, and gets triggered whenever the user


  • 添加/删除/更新联系人

  • 已安装/卸载应用程序

  • 添加/删除/重命名文件的FS

你觉得这是可能的家伙? (当然在一个适当的方式,如果有可能被黑客做到这一点,脏东西我会通过)

Do you think this is possible guys? (in a proper way of course, if it's possible to do it by hacking and dirty stuff I'd pass)

我想看看在互联网上一下,但没有发现与此相关的问题进行讨论。

I tried to look over the internet a bit but didn't find discussions related to this point.

什么是你的猜测?

推荐答案

没有尝试过任何这我自己,但:

Haven't tried any of this myself, but:

http://mylifewithandroid.blogspot.com/2008/03/observing- content.html 看来对付检测的接触数据的变化。基本上你需要注册一个 ContentObserver 和处理通知您的。变化

http://mylifewithandroid.blogspot.com/2008/03/observing-content.html seems to deal with detecting contact data changes. Basically you need to register a ContentObserver and handle the changes you are notified of.

查看 http://developer.android.com/reference/android/内容/ Intent.html - 从您可以注册正在安装或卸载被通知申请一个BroadcastReceiver。查找 ACTION_PACKAGE_ADDED ACTION_PACKAGE_REMOVED

Check out http://developer.android.com/reference/android/content/Intent.html - from that you can register a BroadcastReceiver to be notified of applications being installed or uninstalled. Look for ACTION_PACKAGE_ADDED and ACTION_PACKAGE_REMOVED

请参阅<一个href=\"http://stackoverflow.com/questions/4604223/how-to-detect-file-or-folder-changes-in-android\">how要检测文件或文件夹的变化在Android中?获取文件时在文件系统中被更改如何检测。您可能会被限制在一个FileObserver沙箱,我不知道。此外 - 重命名似乎没有明确通知,但你可能会从检测到它 MOVED_FROM 然后按 MOVED_TO ,或者可能是一个删除然后按创建

Please refer to how to Detect file or folder changes In Android?. for how to detect when files are changed in the filesystem. You may be limited to your sandbox with a FileObserver, I'm not sure. Also - a rename doesn't seem to be explicitly notified, but you will probably detect it from a MOVED_FROM followed by MOVED_TO, or possibly a DELETE followed by CREATE

这篇关于钩一些规律性的任务是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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