Android Open Source - wifiManager Wifi State Broad Cast






From Project

Back to project page wifiManager.

License

The source code is released under:

Apache License

If you think the Android project wifiManager listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.txmcu.WifiManager;
//from w ww.ja v a 2  s .co m
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.wifi.WifiManager;
import android.util.Log;

import com.txmcu.WifiManager.WifiHotManager.OpretionsType;
import com.txmcu.WifiManager.WifiHotManager.WifiBroadCastOperations;

public class WifiStateBroadCast extends BroadcastReceiver {

  private WifiBroadCastOperations operations;

  private OpretionsType type;

  private String SSID;
    private String pWDString;
  public WifiStateBroadCast(WifiBroadCastOperations operations, String SSID,String pwd) {

    this.operations = operations;
    this.SSID = SSID;
    this.pWDString = pwd;
  }

  public void setOpType(OpretionsType type) {
    this.type = type;
  }

  @Override
  public void onReceive(Context context, Intent intent) {
    if (WifiManager.WIFI_STATE_CHANGED_ACTION.equals(intent.getAction())) {// ??????wifi????????wifi?????
      int wifiState = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, 0);
      Log.i("WIFI???", "wifiState" + wifiState);
      switch (wifiState) {
      case WifiManager.WIFI_STATE_DISABLED:
        break;
      case WifiManager.WIFI_STATE_DISABLING:
        break;
      case WifiManager.WIFI_STATE_ENABLED:
        if (type != null) {
          operations.operationByType(type, SSID,pWDString);
        }
        break;
      }
    }

  }

}




Java Source Code List

com.txmcu.WifiManager.Global.java
com.txmcu.WifiManager.WifiConnectBroadCast.java
com.txmcu.WifiManager.WifiHotAdmin.java
com.txmcu.WifiManager.WifiHotConfigAdmin.java
com.txmcu.WifiManager.WifiHotManager.java
com.txmcu.WifiManager.WifiScanRsultBroadCast.java
com.txmcu.WifiManager.WifiStateBroadCast.java
com.txmcu.wifimanagerdemo.AddDeviceActivity.java
com.txmcu.wifimanagerdemo.MainActivity.java
com.txmcu.wifimanagerdemo.SettingActivity.java
com.txmcu.wifimanagerdemo.XiaoXinAdapter.java
com.txmcu.wifimanagerdemo.XiaoxinInfo.java
com.txmcu.xiaoxin.Udpclient.java
com.txmcu.xiaoxin.XinStateManager.java