当前位置: 首页>>代码示例>>Java>>正文


Java WifiParsedResult.getPassword方法代码示例

本文整理汇总了Java中com.google.zxing.client.result.WifiParsedResult.getPassword方法的典型用法代码示例。如果您正苦于以下问题:Java WifiParsedResult.getPassword方法的具体用法?Java WifiParsedResult.getPassword怎么用?Java WifiParsedResult.getPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.zxing.client.result.WifiParsedResult的用法示例。


在下文中一共展示了WifiParsedResult.getPassword方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doInBackground

import com.google.zxing.client.result.WifiParsedResult; //导入方法依赖的package包/类
@Override
protected Object doInBackground(WifiParsedResult... args) {
  WifiParsedResult theWifiResult = args[0];
  // Start WiFi, otherwise nothing will work
  if (!wifiManager.isWifiEnabled()) {
    Log.i(TAG, "Enabling wi-fi...");
    if (wifiManager.setWifiEnabled(true)) {
      Log.i(TAG, "Wi-fi enabled");
    } else {
      Log.w(TAG, "Wi-fi could not be enabled!");
      return null;
    }
    // This happens very quickly, but need to wait for it to enable. A little busy wait?
    int count = 0;
    while (!wifiManager.isWifiEnabled()) {
      if (count >= 10) {
        Log.i(TAG, "Took too long to enable wi-fi, quitting");
        return null;
      }
      Log.i(TAG, "Still waiting for wi-fi to enable...");
      try {
        Thread.sleep(1000L);
      } catch (InterruptedException ie) {
        // continue
      }
      count++;
    }
  }
  String networkTypeString = theWifiResult.getNetworkEncryption();
  NetworkType networkType;
  try {
    networkType = NetworkType.forIntentValue(networkTypeString);
  } catch (IllegalArgumentException ignored) {
    Log.w(TAG, "Bad network type; see NetworkType values: " + networkTypeString);
    return null;
  }
  if (networkType == NetworkType.NO_PASSWORD) {
    changeNetworkUnEncrypted(wifiManager, theWifiResult);
  } else {
    String password = theWifiResult.getPassword();
    if (password != null && !password.isEmpty()) {
      if (networkType == NetworkType.WEP) {
        changeNetworkWEP(wifiManager, theWifiResult);
      } else if (networkType == NetworkType.WPA) {
        changeNetworkWPA(wifiManager, theWifiResult);
      }
    }
  }
  return null;
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:51,代码来源:WifiConfigManager.java

示例2: doInBackground

import com.google.zxing.client.result.WifiParsedResult; //导入方法依赖的package包/类
@Override
protected Object doInBackground(WifiParsedResult... args) {
    WifiParsedResult theWifiResult = args[0];
    // Start WiFi, otherwise nothing will work
    if (!wifiManager.isWifiEnabled()) {
        Log.i(TAG, "Enabling wi-fi...");
        if (wifiManager.setWifiEnabled(true)) {
            Log.i(TAG, "Wi-fi enabled");
        } else {
            Log.w(TAG, "Wi-fi could not be enabled!");
            return null;
        }
        // This happens very quickly, but need to wait for it to enable. A little busy wait?
        int count = 0;
        while (!wifiManager.isWifiEnabled()) {
            if (count >= 10) {
                Log.i(TAG, "Took too long to enable wi-fi, quitting");
                return null;
            }
            Log.i(TAG, "Still waiting for wi-fi to enable...");
            try {
                Thread.sleep(1000L);
            } catch (InterruptedException ie) {
                // continue
            }
            count++;
        }
    }
    String networkTypeString = theWifiResult.getNetworkEncryption();
    NetworkType networkType;
    try {
        networkType = NetworkType.forIntentValue(networkTypeString);
    } catch (IllegalArgumentException ignored) {
        Log.w(TAG, "Bad network type; see NetworkType values: " + networkTypeString);
        return null;
    }
    if (networkType == NetworkType.NO_PASSWORD) {
        changeNetworkUnEncrypted(wifiManager, theWifiResult);
    } else {
        String password = theWifiResult.getPassword();
        if (password != null && !password.isEmpty()) {
            switch (networkType) {
                case WEP:
                    changeNetworkWEP(wifiManager, theWifiResult);
                    break;
                case WPA:
                    changeNetworkWPA(wifiManager, theWifiResult);
                    break;
            }
        }
    }
    return null;
}
 
开发者ID:xiong-it,项目名称:ZXingAndroidExt,代码行数:54,代码来源:WifiConfigManager.java

示例3: doInBackground

import com.google.zxing.client.result.WifiParsedResult; //导入方法依赖的package包/类
@Override
protected Object doInBackground(WifiParsedResult... args) {
	WifiParsedResult theWifiResult = args[0];
	// Start WiFi, otherwise nothing will work
	if (!wifiManager.isWifiEnabled()) {
		Log.i(TAG, "Enabling wi-fi...");
		if (wifiManager.setWifiEnabled(true)) {
			Log.i(TAG, "Wi-fi enabled");
		} else {
			Log.w(TAG, "Wi-fi could not be enabled!");
			return null;
		}
		// This happens very quickly, but need to wait for it to enable. A
		// little busy wait?
		int count = 0;
		while (!wifiManager.isWifiEnabled()) {
			if (count >= 10) {
				Log.i(TAG, "Took too long to enable wi-fi, quitting");
				return null;
			}
			Log.i(TAG, "Still waiting for wi-fi to enable...");
			try {
				Thread.sleep(1000L);
			} catch (InterruptedException ie) {
				// continue
			}
			count++;
		}
	}
	String networkTypeString = theWifiResult.getNetworkEncryption();
	NetworkType networkType;
	try {
		networkType = NetworkType.forIntentValue(networkTypeString);
	} catch (IllegalArgumentException ignored) {
		Log.w(TAG, "Bad network type; see NetworkType values: " + networkTypeString);
		return null;
	}
	if (networkType == NetworkType.NO_PASSWORD) {
		changeNetworkUnEncrypted(wifiManager, theWifiResult);
	} else {
		String password = theWifiResult.getPassword();
		if (password != null && !password.isEmpty()) {
			if (networkType == NetworkType.WEP) {
				changeNetworkWEP(wifiManager, theWifiResult);
			} else if (networkType == NetworkType.WPA) {
				changeNetworkWPA(wifiManager, theWifiResult);
			}
		}
	}
	return null;
}
 
开发者ID:xiong-it,项目名称:PortraitZXing,代码行数:52,代码来源:WifiConfigManager.java

示例4: doInBackground

import com.google.zxing.client.result.WifiParsedResult; //导入方法依赖的package包/类
@Override
protected Object doInBackground(WifiParsedResult... args) {
    WifiParsedResult theWifiResult = args[0];
    // Start WiFi, otherwise nothing will work
    if (!wifiManager.isWifiEnabled()) {
        Log.i(TAG, "Enabling wi-fi...");
        if (wifiManager.setWifiEnabled(true)) {
            Log.i(TAG, "Wi-fi enabled");
        } else {
            Log.w(TAG, "Wi-fi could not be enabled!");
            return null;
        }
        // This happens very quickly, but need to wait for it to enable. A little busy wait?
        int count = 0;
        while (!wifiManager.isWifiEnabled()) {
            if (count >= 10) {
                Log.i(TAG, "Took too long to enable wi-fi, quitting");
                return null;
            }
            Log.i(TAG, "Still waiting for wi-fi to enable...");
            try {
                Thread.sleep(1000L);
            } catch (InterruptedException ie) {
                // continue
            }
            count++;
        }
    }
    String networkTypeString = theWifiResult.getNetworkEncryption();
    NetworkType networkType;
    try {
        networkType = NetworkType.forIntentValue(networkTypeString);
    } catch (IllegalArgumentException ignored) {
        Log.w(TAG, "Bad network type; see NetworkType values: " + networkTypeString);
        return null;
    }
    if (networkType == NetworkType.NO_PASSWORD) {
        changeNetworkUnEncrypted(wifiManager, theWifiResult);
    } else {
        String password = theWifiResult.getPassword();
        if (password != null && !password.isEmpty()) {
            if (networkType == NetworkType.WEP) {
                changeNetworkWEP(wifiManager, theWifiResult);
            } else if (networkType == NetworkType.WPA) {
                changeNetworkWPA(wifiManager, theWifiResult);
            }
        }
    }
    return null;
}
 
开发者ID:areebbeigh,项目名称:QRCodeUtility,代码行数:51,代码来源:WifiConfigManager.java

示例5: doInBackground

import com.google.zxing.client.result.WifiParsedResult; //导入方法依赖的package包/类
@Override
protected Object doInBackground(WifiParsedResult... args) {
  WifiParsedResult theWifiResult = args[0];
  // Start WiFi, otherwise nothing will work
  if (!wifiManager.isWifiEnabled()) {
    Log.i(TAG, "Enabling wi-fi...");
    if (wifiManager.setWifiEnabled(true)) {
      Log.i(TAG, "Wi-fi enabled");
    } else {
      Log.w(TAG, "Wi-fi could not be enabled!");
      return null;
    }
    // This happens very quickly, but need to wait for it to enable. A little busy wait?
    int count = 0;
    while (!wifiManager.isWifiEnabled()) {
      if (count >= 10) {
        Log.i(TAG, "Took too long to enable wi-fi, quitting");
        return null;
      }
      Log.i(TAG, "Still waiting for wi-fi to enable...");
      try {
        Thread.sleep(1000L);
      } catch (InterruptedException ie) {
        // continue
      }
      count++;
    }
  }
  String networkTypeString = theWifiResult.getNetworkEncryption();
  NetworkType networkType;
  try {
    networkType = NetworkType.forIntentValue(networkTypeString);
  } catch (IllegalArgumentException iae) {
    Log.w(TAG, "Bad network type; see NetworkType values: " + networkTypeString);
    return null;
  }
  if (networkType == NetworkType.NO_PASSWORD) {
    changeNetworkUnEncrypted(wifiManager, theWifiResult);
  } else {
    String password = theWifiResult.getPassword();
    if (password != null && password.length() != 0) {
      if (networkType == NetworkType.WEP) {
        changeNetworkWEP(wifiManager, theWifiResult);
      } else if (networkType == NetworkType.WPA) {
        changeNetworkWPA(wifiManager, theWifiResult);
      }
    }
  }
  return null;
}
 
开发者ID:atomsheep,项目名称:sres-app,代码行数:51,代码来源:WifiConfigManager.java

示例6: doInBackground

import com.google.zxing.client.result.WifiParsedResult; //导入方法依赖的package包/类
@Override
protected Object doInBackground(WifiParsedResult... args) {
    WifiParsedResult theWifiResult = args[0];
    // Start WiFi, otherwise nothing will work
    if (!wifiManager.isWifiEnabled()) {
        Log.i(TAG, "Enabling wi-fi...");
        if (wifiManager.setWifiEnabled(true)) {
            Log.i(TAG, "Wi-fi enabled");
        } else {
            Log.w(TAG, "Wi-fi could not be enabled!");
            return null;
        }
        // This happens very quickly, but need to wait for it to enable. A little busy wait?
        int count = 0;
        while (!wifiManager.isWifiEnabled()) {
            if (count >= 10) {
                Log.i(TAG, "Took too long to enable wi-fi, quitting");
                return null;
            }
            Log.i(TAG, "Still waiting for wi-fi to enable...");
            try {
                Thread.sleep(1000L);
            } catch (InterruptedException ie) {
                // continue
            }
            count++;
        }
    }
    String networkTypeString = theWifiResult.getNetworkEncryption();
    NetworkType networkType;
    try {
        networkType = NetworkType.forIntentValue(networkTypeString);
    } catch (IllegalArgumentException ignored) {
        Log.w(TAG, "Bad network type; see NetworkType values: " + networkTypeString);
        return null;
    }
    if (networkType == NetworkType.NO_PASSWORD) {
        changeNetworkUnEncrypted(wifiManager, theWifiResult);
    } else {
        String password = theWifiResult.getPassword();
        if (password != null && password.length() != 0) {
            if (networkType == NetworkType.WEP) {
                changeNetworkWEP(wifiManager, theWifiResult);
            } else if (networkType == NetworkType.WPA) {
                changeNetworkWPA(wifiManager, theWifiResult);
            }
        }
    }
    return null;
}
 
开发者ID:yakovenkodenis,项目名称:Discounty,代码行数:51,代码来源:WifiConfigManager.java

示例7: doInBackground

import com.google.zxing.client.result.WifiParsedResult; //导入方法依赖的package包/类
@Override
protected Object doInBackground(WifiParsedResult... args) {
    WifiParsedResult theWifiResult = args[0];
    // Start WiFi, otherwise nothing will work
    if (!wifiManager.isWifiEnabled()) {
        Log.i(TAG, "Enabling wi-fi...");
        if (wifiManager.setWifiEnabled(true)) {
            Log.i(TAG, "Wi-fi enabled");
        } else {
            Log.w(TAG, "Wi-fi could not be enabled!");
            return null;
        }
        // This happens very quickly, but need to wait for it to enable. A little busy wait?
        int count = 0;
        while (!wifiManager.isWifiEnabled()) {
            if (count >= 10) {
                Log.i(TAG, "Took too long to enable wi-fi, quitting");
                return null;
            }
            Log.i(TAG, "Still waiting for wi-fi to enable...");
            try {
                Thread.sleep(1000L);
            } catch (InterruptedException ie) {
                // continue
            }
            count++;
        }
    }
    String networkTypeString = theWifiResult.getNetworkEncryption();
    NetworkType networkType;
    try {
        networkType = NetworkType.forIntentValue(networkTypeString);
    } catch (IllegalArgumentException iae) {
        Log.w(TAG, "Bad network type; see NetworkType values: " + networkTypeString);
        return null;
    }
    if (networkType == NetworkType.NO_PASSWORD) {
        changeNetworkUnEncrypted(wifiManager, theWifiResult);
    } else {
        String password = theWifiResult.getPassword();
        if (password != null && password.length() != 0) {
            if (networkType == NetworkType.WEP) {
                changeNetworkWEP(wifiManager, theWifiResult);
            } else if (networkType == NetworkType.WPA) {
                changeNetworkWPA(wifiManager, theWifiResult);
            }
        }
    }
    return null;
}
 
开发者ID:thomas-bornschlegel,项目名称:AndroidMultiChannelMiddleware,代码行数:51,代码来源:WifiConfigManager.java


注:本文中的com.google.zxing.client.result.WifiParsedResult.getPassword方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。