Code example for WifiInfo

Methods: getNetworkId

0
						.getSystemService(Context.WIFI_SERVICE);
				WifiInfo info = wifiManager.getConnectionInfo();
				if (!wifiManager.isWifiEnabled() || -1 == info.getNetworkId()) {
					CUR_NETSTATE = NetState.Mobile;
				} 
			} 
		} 
 
	} 
 
	public static HttpHost getAPN() {
		HttpHost proxy = null;
		Uri uri = Uri.parse("content://telephony/carriers/preferapn");
		Cursor mCursor = null;
		if (null != mContext) {
			mCursor = mContext.getContentResolver().query(uri, null, null, null, null);
		} 
		if (mCursor != null && mCursor.moveToFirst()) {
			String proxyStr = mCursor.getString(mCursor.getColumnIndex("proxy"));
			if (proxyStr != null && proxyStr.trim().length() > 0) {
				proxy = new HttpHost(proxyStr, 80);