模拟用户输入 [英] Simulate user input

查看:123
本文介绍了模拟用户输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能以模拟的Andr​​oid用户输入?

例如有一些服务,或者某些线程会在后台运行,并启动的东西,将模拟用户输入,所以如果我们在主屏幕和模拟输入上(让说点击)发生了比应用程序如果坐标应该开始模拟点击指向主屏幕上的图标的一些,或者让说开一个时钟,如果模拟输入点的时钟区...

或者,如果一些的EditText具有焦点,然后按键的模拟输入启动的EditText应该充满一些文字。 。

我相信这可以在.NET或Java来完成,但我不知道这是否是可能的Andr​​oid


解决方案

  

是否有可能以模拟的Andr​​oid用户输入?


仅从一个单元测试套件。 IOW,而不是你所想,因为这将是一个巨大的安全漏洞的方式。

Is it possible to simulate user input in android ?

For example to have some service or some thread that will work in background and initiate something that will simulate user input so if we are on the home screen and simulated input(let say click) happened than the application should start if the coordinates of the simulated click point to some icon on the home screen , or let say open a clock if the simulated input points to the clock area ...

or maybe if some edittext have focus and the simulated input of keystrokes start then the edittext should be filled with some text . . .

I am sure that this can be done in .Net or java but I do not know if it is possible in android

解决方案

Is it possible to simulate user input in android ?

Only from a unit test suite. IOW, not in the way that you are thinking, as it would be a massive security hole.

这篇关于模拟用户输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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