除了使用坐标之外,还有什么方法可以在monkeyrunner中打开wifi
除了使用坐标之外,还有什么方法可以在monkeyrunner中打开wifi吗?我们可以使用monkeyrunner中的WifiManager api吗?
从 android.net.wifi 导入 WifiManger 将 android.jar 文件复制到 tool/lib 位置后可以正常工作。但是如何使用 Monkeyrunner/monkey 在 android fon 中调用 WifiManger 方法..?请有人帮忙。
Is there any way to switch on wifi in monkeyrunner otherthan using the cordinates.?Can we use WifiManager api from monkeyrunner.
from android.net.wifi import WifiManger
is working after copying android.jar file to tool/lib location.But how to invoke the WifiManger methods inside a android fon using monkeyrunner/monkey..??Somebody please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过其他方式打开 Wi-Fi。启动设置活动并转到“无线和网络设置”并启用它。
以下代码是设置活动的启动:
之后通过按下事件使用“DOWN”和“ENTER”KeyCode,您可以启用 wi-fi...!!!
You can switch on the wi-fi by another way. Start the activity of settings and go to the "wireless & network settings" and enable it.
Following code is the start the activity of the settings:
After that by the press event use 'DOWN' and 'ENTER' KeyCode and you can enable the wi-fi...!!!
几个月前我研究过这个确切的问题。对我来说这似乎不可能;至少很容易。我能找到的最好方法是使用 startActivity 尽可能接近 wi-fi 设置,然后在 D-PAD 命令中进行编程,直到突出显示正确的字段。您也许可以使用此逻辑来开发一个小型的专用构建应用程序,该应用程序可通过 onCreate 或 onResume 切换 wi-fi。就我而言,不值得花费这么多时间。
I looked into this exact issue a few months ago. It did not seem possible to me; at least easily. The best way I could find was to use startActivity to get as close to the wi-fi settings as possible, and then program in D-PAD commands until the correct field was highlighted. You may be able to use this logic to develop a small, purpose build, app that onCreate or onResume toggles wi-fi. In my case, it was not worth the amount of time this would have taken.