0

I am writing MonkeyRunner script which checks state of wifi and enables it.

For doing so I am importing android API and its classes. Below is code snippet;

from android.net.wifi import WifiManager
global state
state = WifiManager.isWifiEnabled()
print state

While executing I am getting an error as:

state = WifiManager.isWifiEnabled()
TypeError: isWifiEnabled(): expected 1 args; got 0

Then I realized I need permission for doing wifi operation and found in some Manifest.XML file, where they have used

My doubt is I am running the script on real device and how can I use in my MonkeyRunner script file.

Thanks in Advance Surendra Valsangker

ifixthat
  • 6,137
  • 5
  • 25
  • 42
surendra
  • 1
  • 2
  • 1
    It's not clear from where you are importing your classes... – Diego Torres Milano Jan 19 '13 at 08:09
  • from android-sdk-windows\platforms\android-17 platform folder I have imported android.jar and kept it in android-sdk-windows\tools folder where monkeyrunner.bat and my script file is present. as I informed in my script file I have used "from android.net.wifi import WifiManager" to access WifiManager class – surendra Jan 23 '13 at 05:51

0 Answers0