【问题标题】:how to check WiFi connection is automatic or established manually in android?如何在android中检查WiFi连接是自动建立的还是手动建立的?
【发布时间】:2012-02-14 00:20:53
【问题描述】:

我正在做一个小型的 android 应用程序,它将显示已建立的 WiFi 连接是自动的还是手动的。是否可以使用用户在默认“设置”应用程序中设置的 WiFi 接入点?

谢谢,瓦尼

【问题讨论】:

  • 你想通过代码进行WiFi设置吗?
  • 不,我想检查已建立的 WiFi 连接是自动还是手动

标签: android android-intent connection android-wifi


【解决方案1】:

看到这个

 [ www.developer.android.com/reference/android/net/wifi/package-summary.html] 

WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
 if (wifiManager != null) {
     WifiInfo info = wifiManager.getConnectionInfo();
     if (info != null) {
        String ssid = info.getSSID();
        ...
   }           
 }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-08-18
    • 1970-01-01
    • 2020-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-15
    • 2020-06-24
    相关资源
    最近更新 更多