0

I try to make a wifi scanner. So, I run this Bellow code in pydroid3. And getting this error. How can I fix it. If you know please tell me how can I make a wifi scanner android app.

import kivymd,kivy
from wifidroid.wifi import WifiManager

wifi = WifiManager()
wifi.startScan()
print(wifi.allScanResults)

Error:

Traceback (most recent call last):
   File "/storage/emulated/0/Subtitles/newfile.py", line 5, in <module>
     from android.permissions import request_permissions, Permission
   File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/wifidroid/wifi.py", line 65, in startScan
     self.__Service.startScan()
   File "jnius/jnius_export_class.pxi", line 1145, in jnius.jnius.JavaMultipleMethod.__call__
   File "jnius/jnius_export_class.pxi", line 857, in jnius.jnius.JavaMethod.__call__
   File "jnius/jnius_export_class.pxi", line 954, in jnius.jnius.JavaMethod.call_method
   File "jnius/jnius_utils.pxi", line 91, in jnius.jnius.check_exception
 jnius.jnius.JavaException: JVM exception occurred: WifiService: Neither user 10260 nor current process has android.permission.CHANGE_WIFI_STATE. java.lang.SecurityException
MSH
  • 1,743
  • 2
  • 14
  • 22
  • The error is clear. In order to access the hardware you'll need permission. So first you need to find a way to gain that permission. – MSH Apr 06 '22 at 08:26
  • How can I do that. I installed pydroid permission plugin isn't not working. I also try this in Kali machine till getting this error – Alamin Sarkar Apr 06 '22 at 08:28
  • Does this help? https://stackoverflow.com/questions/68990650/what-is-the-correct-way-to-create-permission-in-androidpython-for-android – MSH Apr 06 '22 at 08:30
  • Not working.... – Alamin Sarkar Apr 06 '22 at 08:41

0 Answers0