from plyer import wifi wifi.disconnect()
from wifidroid.wifi import WifiManager
#Activating Wifi (To activate it use True and to deactivate it use False
wifi = WifiManager()
wifi.EnabledWifi(False)import winwifi
winwifi.WinWiFi.disconnect()--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/1e135ebc-6bb9-4cff-9875-267dcfdee8d9n%40googlegroups.com.
Just INTERNET
On Sunday, August 29, 2021, Robert <planckp...@gmail.com> wrote:
Are permissions set?--On Saturday, August 28, 2021 at 1:00:11 PM UTC-10 aliza...@gmail.com wrote:I used several ways to turn off Wi-Fi with one button.
1) From This site :https://github.com/kivy/plyer/blob/master/plyer/facades/wifi.pyfrom plyer import wifi wifi.disconnect()
2) From This site: https://pypi.org/project/wifidroid/from wifidroid.wifi import WifiManager #Activating Wifi (To activate it use True and to deactivate it use False wifi = WifiManager() wifi.EnabledWifi(False)3) and this code:import winwifiwinwifi.WinWiFi.disconnect()
But none of these methods worked. Thank you in advance for your help.
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
08-29 16:46:26.829 20031 20403 I python : Traceback (most recent call last):
08-29 16:46:26.830 20031 20403 I python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/oscservice/plyer/utils.py", line 93, in _ensure_obj
08-29 16:46:26.830 20031 20403 I python : ModuleNotFoundError: No module named 'plyer.platforms.android.wifi'
08-29 16:46:26.830 20031 20403 I python : [INFO ] [Base ] Leaving application in progress...
08-29 16:46:26.831 20031 20403 I python : Traceback (most recent call last):
08-29 16:46:26.831 20031 20403 I python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/app/main.py", line 380, in <module>
08-29 16:46:26.831 20031 20403 I python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/oscservice/kivy/app.py", line 950, in run
08-29 16:46:26.832 20031 20403 I python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/oscservice/kivy/base.py", line 582, in runTouchApp
08-29 16:46:26.832 20031 20403 I python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/oscservice/kivy/base.py", line 347, in mainloop
08-29 16:46:26.832 20031 20403 I python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/oscservice/kivy/base.py", line 391, in idle
08-29 16:46:26.833 20031 20403 I python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/oscservice/kivy/base.py", line 342, in dispatch_input
08-29 16:46:26.833 20031 20403 I python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/oscservice/kivy/base.py", line 308, in post_dispatch_input
08-29 16:46:26.833 20031 20403 I python : File "kivy/_event.pyx", line 709, in kivy._event.EventDispatcher.dispatch
08-29 16:46:26.834 20031 20403 I python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/oscservice/kivy/uix/behaviors/button.py", line 179, in on_touch_up
08-29 16:46:26.834 20031 20403 I python : File "kivy/_event.pyx", line 705, in kivy._event.EventDispatcher.dispatch
08-29 16:46:26.834 20031 20403 I python : File "kivy/_event.pyx", line 1248, in kivy._event.EventObservers.dispatch
08-29 16:46:26.835 20031 20403 I python : File "kivy/_event.pyx", line 1132, in kivy._event.EventObservers._dispatch
08-29 16:46:26.835 20031 20403 I python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/oscservice/kivy/lang/builder.py", line 57, in custom_callback
08-29 16:46:26.835 20031 20403 I python : File "/data/data/org.kivy.oscservice/files/app/main.kv", line 108, in <module>
08-29 16:46:26.842 20031 20403 I python : on_release:root.ralay1();app.add_card();root.disconnectWifi()
08-29 16:46:26.842 20031 20403 I python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/app/main.py", line 157, in disconnectWifi
08-29 16:46:26.843 20031 20403 I python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/oscservice/plyer/facades/wifi.py", line 158, in disable
08-29 16:46:26.843 20031 20403 I python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/oscservice/plyer/facades/wifi.py", line 187, in _disable
08-29 16:46:26.843 20031 20403 I python : NotImplementedError
08-29 16:46:26.843 20031 20403 I python : Python for android ended.
from wifidroid.wifi import WifiManager
wifi = WifiManager()
wifi.EnabledWifi(False)I researched this, came to the conclusion that I could create permission in the program as well. so I used the following code.
if platform == 'android':
from android.permissions import request_permissions, Permission
request_permissions([Permission.CHANGE_WIFI_STATE])
After adding the above three lines, The app crashes during execution. In debug mode it gives this message.
08-31 01:48:47.898 32527 32549 I python : Initializing Python for Android
08-31 01:48:47.899 32527 32549 I python : Setting additional env vars from p4a_env_vars.txt
08-31 01:48:47.899 32527 32549 I python : Changing directory to the one provided by ANDROID_ARGUMENT
08-31 01:48:47.899 32527 32549 I python : /data/user/0/org.kivy.oscservice/files/app
08-31 01:48:47.899 32527 32549 I python : Preparing to initialize python
08-31 01:48:47.899 32527 32549 I python : _python_bundle dir exists
08-31 01:48:47.899 32527 32549 I python : calculated paths to be...
08-31 01:48:47.899 32527 32549 I python : /data/user/0/org.kivy.oscservice/files/app/_python_bundle/stdlib.zip:/data/user/0/org.kivy.oscservice/files/app/_python_bundle/modules
08-31 01:48:47.899 32527 32549 I python : set wchar paths...
08-31 01:48:48.020 32527 32549 I python : Initialized python
08-31 01:48:48.020 32527 32549 I python : AND: Init threads
08-31 01:48:48.024 32527 32549 I python : AND: Ran string
08-31 01:48:48.024 32527 32549 I python : Run user program, change dir and execute entrypoint
08-31 01:48:49.050 32476 32506 I python : [WARNING] [Base ] Unknown <android> provider
08-31 01:48:49.050 32476 32506 I python : [INFO ] [Base ] Start application main loop
08-31 01:48:49.054 32476 32506 I python : Python for android ended.
How can I create a permission message that the user will allow forever?
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/a3355747-fec5-400f-b16d-fd80906d208bn%40googlegroups.com.