0

I've created with python and kivy an android app that works offline, app shows landscape photos, how can i open my app only when wifi is enabled? to let my app upload ads,have patience with me im new Thank You.

3 Answers3

0

You can use pyjnius to query the Android Java APIs for wifi connection information.

In general you can also use plyer for pre-written Python interfaces to these APIs, but in this case it looks like wifi isn't yet supported there on Android or OS X.

inclement
  • 29,124
  • 4
  • 48
  • 60
0

There's a dirty method though.. try requesting google.com or any other reliable website in the background with urllib or requests or socket, if its not getting any reply it must mean that system is not connected to internet

Adarsh Kumar
  • 1
  • 1
  • 1
  • 1
0

First, try to search for internet connection and not only wifi, because the user can want to use his mobile data instead of wifi.

maybe this could help you: Checking network connection

Metalicat
  • 3
  • 3