user2910088
user2910088

Reputation: 13

Does anyone know if i can access and mange wifi connection using kivy?

I want to see to which wifi network i am connected on my android device using kivy Platform? cant find any reference, do you know if its possible and if it is, how its done.

Thanks

I tried implementing it as you suggested: for some reason none of the wifimanger methods i am using(getconnectioninfo) keep on failing. anyone sees what i am missing here?

    import jnius
    PythonActivity = jnius.autoclass('org.renpy.android.PythonActivity')
    activity = PythonActivity.mActivity
    WifiManager = jnius.autoclass('android.net.wifi.WifiManager')
    WifiName= jnius.autoclass('android.net.wifi.WifiInfo')
    network_name = WifiName()



    wifi_service = activity.getSystemService(PythonActivity.WIFI_SERVICE)
    network= wifi_service.getConnectionInfo()
    network_name = network.getBSSID()

    Logger.debug('wifi: wifi_names{0}'.format(network))
    Logger.debug('wifi: wifi_names{0}'.format(type(wifi_service)))

Upvotes: 1

Views: 1186

Answers (1)

inclement
inclement

Reputation: 29460

This is probably possible, you will need to look up the normal android api way to do it then access it directly with pyjnius.

Upvotes: 1

Related Questions