Can Phonegap query the wifi system and return network names?

ε祈祈猫儿з 提交于 2019-12-07 04:23:15

问题


I checked the Phonegap API but what I would like to achieve, getting a list of available wifi networks, seems not supported.

Anyone knows if it's possible at all in the current state?


回答1:


You cannot get a list of available wifi networks at the moment.

PhoneGap will support reading the currently connected network SSID via the system information api (http://www.w3.org/TR/system-info-api/#network).

If you wanted to list all the wifi networks today, you would have to write a PhoneGap plugin -- assuming those APIs are actually available on the devices in which you are interested.




回答2:


Here is a PhoneGap plugin for wifi info https://github.com/HondaDai/PhoneGap-WifiInfoPlugin The code is in Java which means it's for Android. However,

WifiInfo wifiInfo = wifiManager.getConnectionInfo();

This only gives you result for the currently connected wifi network. To get a list of all wifi networks, I believe you can change the WifiInfoPlugin class and use wifiManager.getScanResults(), then store the results in an array or similar.




回答3:


I recently did some research on this and found out it's still not supported.

It might be useful to have a look at the PhoneGap roadmap from time to time.



来源:https://stackoverflow.com/questions/4824841/can-phonegap-query-the-wifi-system-and-return-network-names

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!