简体   繁体   English

限制Android设备Wifi连接

[英]Restrict Android Device Wifi Connection‏

How to force android to connect specifically defined wireless network 如何强制android连接专门定义的无线网络

Is it possible? 可能吗?

User should able to connect defined work wi-fi or wifis, 用户应该能够连接定义的工作wi-fi或wifi,

but should not access any other networks like home. 但不应访问其他任何网络(如家庭网络)。

Firstly for what you want to do that?For your application or the device? 首先要实现的目的是针对应用程序还是设备?

If it's your application you can do restrictions about connection type and network etc. 如果是您的应用程序,则可以对连接类型和网络等进行限制。

But if you are talking about the device you cant achieve something like that unless you have the control of the whole system which is not possible. 但是,如果您谈论的是设备,除非您无法控制整个系统,否则您将无法实现类似的目标。

One option would be to create an app or service that would pick up the: 一种选择是创建将获取以下内容的应用或服务:

NETWORK_STATE_CHANGED_ACTION  Intent 

And then in turn use the 然后依次使用

WifiManager.getConnectionInfo() 

to check whether this is a legitimate network, if not then just disconnect and notify the user. 检查这是否是合法网络,如果不是,则断开连接并通知用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM