简体   繁体   English

如何在不接触扩展Activity的主类的情况下监视应用程序中的用户活动?

[英]How can I monitor user activities in my app without touching the main class that extends Activity?

Suppose an app project is already written, all you want to do is to additionally write a somehow standalone script that captures the onClick, onFocusChange or even onAppear in the app. 假设已经编写了一个应用程序项目,您要做的就是另外编写一个独立的脚本来捕获应用程序中的onClick,onFocusChange或onAppear。 Is that even feasible? 那可行吗? How robust is the approach? 该方法的鲁棒性如何?

All answer I found was to fully add listeners (or global listeners, although less comprehensively functional) for each item or so, which is a boring work for a large project, and not always desired at the end of a production process(where I just cut in). 我发现的所有答案是为大约每个项目完全添加侦听器(或全局侦听器,尽管功能不那么全面),这对于大型项目来说是一项无聊的工作,并且在生产过程的最后(我只是在切入)。

Another purposed approach was to locate the root of the nodes and scan from there? 另一种有针对性的方法是找到节点的根并从那里扫描? Correct me if that's a dead end. 如果那是死胡同,请纠正我。 Other answer mentioned spying app, which is not the case, since it's the original developer who wants to track everything from inside the app. 其他答案提到了间谍应用程序,情况并非如此,因为原始开发人员想从应用程序内部跟踪所有内容。

I am not sure, if this solves your problem but have your extension of views. 我不确定,这是否可以解决您的问题,但您可以扩展意见。 Eg: MyTextView extends TextView then just override the touchEventHandlers, log what you want and dispatch the event down to the listeners. 例如: MyTextView extends TextView然后仅覆盖touchEventHandlers,记录所需内容,然后将事件分派给侦听器。

So instead of normal TextViews , use MyTextView . 因此,请使用MyTextView代替普通的TextViews

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何从Main Extended Activity调用公共变量 - How can I call the public variable from Main extends Activity 如何在不切换活动的情况下使用来自另一个活动的数据和按钮单击从主活动编辑数组? - How can I edit an Array from Main Activity with the data and button click from another Activity without switching between Activities? 我的 Android 应用程序中有大约 1000 个不同的活动。 如何跳转到随机活动? - I have around 1000 different activities in my Android App. How can I jump to a random activity? 如何在应用启动时而非活动创建时设置所有活动的图像视图和文本视图 - How can I set the imageviews and textviews of all my activities at app startup time, not at activity creation 当我从其他活动返回主活动时,我的应用程序崩溃(StackOverflowError) - My app crashes when I return back to my main activity from other activities(StackOverflowError) 如何实现将活动扩展为片段的类? - How can I implement class that extends activity into fragment? 如何从扩展ActionBarActivity的另一个类向我的主要活动添加操作栏? - How to add action bar to my main activity from another class that extends ActionBarActivity? 如何添加将View扩展到主要活动的自定义类? - How to add a custom class that extends View to Main Activity? 如果我的活动已经从另一个活动扩展了,我该如何使用ationbarSherlock? - How can i use ationbarSherlock if my activity already extends from another activity? 如何在不重新启动的情况下将广播接收器的信息发送回我的主要活动 - how can i send information from broadcast receiver back to my main activity without restarting it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM