Android Open Source - androidtool Wifi State






From Project

Back to project page androidtool.

License

The source code is released under:

MIT License

If you think the Android project androidtool 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 org.chris.android.tool.service;
//from   www  .j  ava2s. co  m
import android.net.wifi.WifiManager;
import android.util.SparseArray;

import org.chris.android.tool.R;

public enum WifiState {

    DISABLED(WifiManager.WIFI_STATE_DISABLED, R.string.wifi_state_disabled), DISABLING(
            WifiManager.WIFI_STATE_DISABLING, R.string.wifi_state_disabling), ENABLED(WifiManager.WIFI_STATE_ENABLED,
            R.string.wifi_state_enabled), ENABLING(WifiManager.WIFI_STATE_ENABLING, R.string.wifi_state_enabling),
    UNKNOWN(
            WifiManager.WIFI_STATE_UNKNOWN, R.string.wifi_state_unknown);
    private int state;
    private final static SparseArray<WifiState> states = new SparseArray<>();
    private final int labelTextId;

    static {
        for (WifiState val : values()) {
            states.put(val.state, val);
        }
    }

    private WifiState(int state, int labelTextId) {
        this.state = state;
        this.labelTextId = labelTextId;
    }

    public static WifiState forId(int id) {
        return states.get(id);
    }

    public int getLabelTextId() {
        return labelTextId;
    }
}




Java Source Code List

org.chris.android.tool.MainActivity.java
org.chris.android.tool.TorchHelper.java
org.chris.android.tool.gps.GpsActivity.java
org.chris.android.tool.gps.GpsStatusType.java
org.chris.android.tool.gps.SelectDestinationActivity.java
org.chris.android.tool.mobiledata.DataConnectionNetworkType.java
org.chris.android.tool.mobiledata.DataConnectionState.java
org.chris.android.tool.mobiledata.MobileDataHelper.java
org.chris.android.tool.nfc.NfcActivity.java
org.chris.android.tool.sensor.SensorDetailActivity.java
org.chris.android.tool.sensor.SensorListActivity.java
org.chris.android.tool.sensor.SensorService.java
org.chris.android.tool.sensor.SensorType.java
org.chris.android.tool.service.WifiService.java
org.chris.android.tool.service.WifiState.java