編輯:關於Android編程
public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); WifiManager mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo info = mWifiManager.getConnectionInfo(); // 得到配置好的網絡連接 ListwifiConfigList = mWifiManager.getConfiguredNetworks(); for (int i = 0; i < wifiConfigList.size(); i++) { Log.i("hefeng", wifiConfigList.get(i).toString()); Log.i("hefeng", info.getSSID() + "||" + wifiConfigList.get(i).SSID); if (info.getSSID().equals(wifiConfigList.get(i).SSID)) { Log.e("hefeng", "當前網絡安全性:" + getSecurity(wifiConfigList.get(i))); } } } /** * These values are matched in string arrays -- changes must be kept in sync */ static final int SECURITY_NONE = 0; static final int SECURITY_WEP = 1; static final int SECURITY_PSK = 2; static final int SECURITY_EAP = 3; static int getSecurity(WifiConfiguration config) { if (config.allowedKeyManagement.get(KeyMgmt.WPA_PSK)) { return SECURITY_PSK; } if (config.allowedKeyManagement.get(KeyMgmt.WPA_EAP) || config.allowedKeyManagement.get(KeyMgmt.IEEE8021X)) { return SECURITY_EAP; } return (config.wepKeys[0] != null) ? SECURITY_WEP : SECURITY_NONE; }
public void getCipherType(Context context, String ssid) { WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); Listlist = wifiManager.getScanResults(); for (ScanResult scResult : list) { if (!TextUtils.isEmpty(scResult.SSID) && scResult.SSID.equals(ssid)) { String capabilities = scResult.capabilities; Log.i("hefeng","capabilities=" + capabilities); if (!TextUtils.isEmpty(capabilities)) { if (capabilities.contains("WPA") || capabilities.contains("wpa")) { Log.i("hefeng", "wpa"); } else if (capabilities.contains("WEP") || capabilities.contains("wep")) { Log.i("hefeng", "wep"); } else { Log.i("hefeng", "no"); } } } } }
一.問題引入ListView控件:給Item綁定了點擊事件,卻點擊無效。二.解決方案ListView使用了自定義布局文件,在布局文件中有button等控件時,這些控件獲取
識別身份證信息需要用到圖像處理的知識,無奈水平不夠,於是尋找第三方接口,但是找到的都是收費的,後來找到一個叫雲脈的產品http://ocr.ccyunmai.com/,發
最近做了一個簡單的3D效果翻頁特效,先說說我的思路吧,首先我這個翻頁效果並不是兩個Activity之間的跳轉,而是在同一個activity類切換不同的view而已。我現在
1. Why,為什麼要加載縮略圖? 有的時候不需要展示原圖,只需展示圖片的縮略圖,可以節省內存。比如:網易新聞中的圖片浏覽,左邊展示的小獅子圖片就是一個縮略