how to get the IP of the wifi hotspot in Android?

后端 未结 7 1232
半阙折子戏
半阙折子戏 2021-02-02 14:11

As the title says... I\'m trying to be able to get the IP of the wifi iface when it is configured as hotspot. Ideally, I would like to find something that works for all the phon

7条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-02 14:54

    I use the solution of ajma, changing intf.getName().contains("wlan") to intf.getName().contains("wl") || intf.getName().contains("ap"). And it works for many mobile phones.

    But it returns null when you just connected to a WiFi.

提交回复
热议问题