Unable to programatically create working Wi-Fi access point on Jellybean tablet

混江龙づ霸主 提交于 2020-01-15 10:14:10

问题


I am attempting to programatically create a Wi-Fi access point on a Android tablet device (Nexus 10 - 4.2.2) and connect to it from a PC without success. Prior to posting a great slab of code and wasting peoples time, I'd like to check that I'm on the right track. The tablet has no 3G or 4G capability, and therefore does not normally require a access point (aka hot spot).

I am aware that the published Android API does not provide for this. The general technique I am using is described here http://www.whitebyte.info/android/android-wifi-hotspot-manager-class which uses reflection to access the WiFiManager methods

setWifiApConfiguration
and
setWifiApEnabled
. I am also aware that the method has changed since version 4.0 as explained here How to configue a static IP address, netmask, gateway programmatically on Android 3.x or 4.x

Using these methods, I am able to create an access point, and connect to it from a PC, but my attempts to set an IP address on the access point, and then to actually establish a connection (ie ping) from the PC to the tablet have not been successful. I have read many questions and answers here and elsewhere, but so far no luck.

Has anybody tried this or something similar?

How is using these undocumented methods generally regarded?

Has anyone documented the "undocumented" WifiManger methods?

Thanks Steve

来源:https://stackoverflow.com/questions/16050143/unable-to-programatically-create-working-wi-fi-access-point-on-jellybean-tablet

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