Android: Simulate WiFi in the emulator?

前端 未结 6 1584
礼貌的吻别
礼貌的吻别 2020-11-28 10:35

I would like to check from my app whether the device has WiFi connectivity, but in order to do that, I must first find a way to get \"WiFi\" in the emulator. Just going to <

6条回答
  •  借酒劲吻你
    2020-11-28 10:51

    In theory, linux (the kernel underlying android) has mac80211_hwsim driver, which simulates WiFi. It can be used to set up several WiFi devices (an acces point, and another WiFi device, and so on), which would make up a WiFi network.

    It's useful for testing WiFi programs under linux. Possibly, even under user-mode linux or other isolated virtual "boxes" with linux.

    In theory, this driver could be used for tests in the android systems where you don't have a real WiFi device (or don't want to use it), and also in some kind of android emulators. Perhaps, one can manage to use this driver in android-x86, or--for testing--in android-x86 run in VirtualBox.

提交回复
热议问题