// Path: src/com/zhongyun/viewer/utils/Constants.java
// public class Constants {
// 
// 	public static final String INTENT_CID = "cid";
// 	public static final String INTENT_CAMERA_NAME = "camera_name";
// 	
// 	public static final String BARCODE_SPLITER = "&";
// 	public static final String BARCODE_DEVICE_ID = "deviceid=";
// 	public static final String BARCODE_CID = "cid=";
// 	public static final String BARCODE_NAME = "name=";
// 	public static final String BARCODE_USER_NAME = "username=";
// 	public static final String BARCODE_PASSWORD = "password=";
// 
// 	public static final String VIDEO_MP4 = ".mp4";
// 	public static final String IMG_JPG = ".jpg";
// 	public static final String RECORD_VIDEO_PATH = "ZhongYun/recordVideo";
// 	public static final String CAPTURE_IAMGE_PATH = "ZhongYun/capture";
// 	public static final String LOCAL_ICON_PATH = "ZhongYun/icon";
// 	public static final String LOCAL_CID_ICON_PATH = "ZhongYun/cid_icon";
// 	
// 	public static final String CONNECTIVITY_CHANGE_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
// 	public static final String CONNECTIVITY_SESSION_STATE = "zhongyun.viewer.session_state";
// }
// 
// Path: src/com/zhongyun/viewer/utils/NetWorkUtil.java
// public class NetWorkUtil
// {
// 
// 	public static int netWorkIsAvailable(Context context)
// 	{
// 		ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
// 		NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo();
// 
// 		if ("0.0.0.0".endsWith(NetUtil.getLocalIp()))
// 		{
// 			return 0;
// 		} else
// 		{
// 			return 1;
// 		}
// 		// if (activeNetInfo == null || !activeNetInfo.isConnected()) {
// 		// return 0;
// 		// } else {
// 		// return 1;
// 		// }
// 	}
// 
// 	public static void openDialog(final Activity context)
// 	{
// 		final Builder builder = new AlertDialog.Builder(context);
// 		builder.setTitle("网络不可用");
// 		builder.setMessage("请连接网络");
// 		builder.setPositiveButton("确定", new DialogInterface.OnClickListener()
// 		{
// 			@Override
// 			public void onClick(DialogInterface dialog, int which)
// 			{
// 				builder.create().dismiss();
// 				context.finish();
// 			}
// 		});
// 		builder.show();
// 	}
// 
// 	public static int getNetType(Context context)
// 	{
// 		ConnectivityManager cwjManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
// 		NetworkInfo netWorkInfo = cwjManager.getActiveNetworkInfo();
// 		if (netWorkInfo != null)
// 		{
// 			boolean flag = netWorkInfo.isAvailable();
// 			if (flag)
// 			{
// 				if (netWorkInfo.getTypeName().equals("WIFI"))
// 				{
// 					return 1;
// 				} else
// 				{
// 					return 0;
// 				}
// 			} else
// 			{
// 				return -1;
// 			}
// 		} else
// 		{
// 			return -1;
// 		}
// 	}
// 
// 	public static String getWifiName(Context context)
// 	{
// 		ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
// 		NetworkInfo wifi_connect = connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
// 		WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
// 		WifiInfo info = wifi.getConnectionInfo();
// 		if (wifi_connect.isConnected())
// 		{
// 			return info.getSSID().toString().replaceAll("\"", "");
// 		} else
// 		{
// 			return "";
// 		}
// 	}
// }


import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.app.AlertDialog.Builder;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.ichano.rvs.viewer.constant.RvsSessionState;
import com.zhongyun.viewer.R;
import com.zhongyun.viewer.utils.Constants;
import com.zhongyun.viewer.utils.NetWorkUtil;
//			backBtn.setOnClickListener(this);
//		}
//		optBtn.setOnClickListener(this);
//		titleText.setText(titleId);
//	}

	@Override
	public void onClick(View v) {
		int id = v.getId();
		if (id == R.id.back_linlayout) {
			this.finish();
		}
	}

	public void showToast(String message) {
		Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
	}

	public void showLongToast(String message) {
		Toast.makeText(this, message, Toast.LENGTH_LONG).show();
	}

	public void showToast(int messageId) {
		Toast.makeText(this, messageId, Toast.LENGTH_SHORT).show();
	}
	int lastType = -1;
	private final BroadcastReceiver broadReceiver = new BroadcastReceiver() {
		@Override
		public void onReceive(Context context, Intent intent) {
			if (intent.getAction().equals(Constants.CONNECTIVITY_CHANGE_ACTION)) {
// Path: src/com/zhongyun/viewer/utils/Constants.java
// public class Constants {
// 
// 	public static final String INTENT_CID = "cid";
// 	public static final String INTENT_CAMERA_NAME = "camera_name";
// 	
// 	public static final String BARCODE_SPLITER = "&";
// 	public static final String BARCODE_DEVICE_ID = "deviceid=";
// 	public static final String BARCODE_CID = "cid=";
// 	public static final String BARCODE_NAME = "name=";
// 	public static final String BARCODE_USER_NAME = "username=";
// 	public static final String BARCODE_PASSWORD = "password=";
// 
// 	public static final String VIDEO_MP4 = ".mp4";
// 	public static final String IMG_JPG = ".jpg";
// 	public static final String RECORD_VIDEO_PATH = "ZhongYun/recordVideo";
// 	public static final String CAPTURE_IAMGE_PATH = "ZhongYun/capture";
// 	public static final String LOCAL_ICON_PATH = "ZhongYun/icon";
// 	public static final String LOCAL_CID_ICON_PATH = "ZhongYun/cid_icon";
// 	
// 	public static final String CONNECTIVITY_CHANGE_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
// 	public static final String CONNECTIVITY_SESSION_STATE = "zhongyun.viewer.session_state";
// }
// 
// Path: src/com/zhongyun/viewer/utils/NetWorkUtil.java
// public class NetWorkUtil
// {
// 
// 	public static int netWorkIsAvailable(Context context)
// 	{
// 		ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
// 		NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo();
// 
// 		if ("0.0.0.0".endsWith(NetUtil.getLocalIp()))
// 		{
// 			return 0;
// 		} else
// 		{
// 			return 1;
// 		}
// 		// if (activeNetInfo == null || !activeNetInfo.isConnected()) {
// 		// return 0;
// 		// } else {
// 		// return 1;
// 		// }
// 	}
// 
// 	public static void openDialog(final Activity context)
// 	{
// 		final Builder builder = new AlertDialog.Builder(context);
// 		builder.setTitle("网络不可用");
// 		builder.setMessage("请连接网络");
// 		builder.setPositiveButton("确定", new DialogInterface.OnClickListener()
// 		{
// 			@Override
// 			public void onClick(DialogInterface dialog, int which)
// 			{
// 				builder.create().dismiss();
// 				context.finish();
// 			}
// 		});
// 		builder.show();
// 	}
// 
// 	public static int getNetType(Context context)
// 	{
// 		ConnectivityManager cwjManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
// 		NetworkInfo netWorkInfo = cwjManager.getActiveNetworkInfo();
// 		if (netWorkInfo != null)
// 		{
// 			boolean flag = netWorkInfo.isAvailable();
// 			if (flag)
// 			{
// 				if (netWorkInfo.getTypeName().equals("WIFI"))
// 				{
// 					return 1;
// 				} else
// 				{
// 					return 0;
// 				}
// 			} else
// 			{
// 				return -1;
// 			}
// 		} else
// 		{
// 			return -1;
// 		}
// 	}
// 
// 	public static String getWifiName(Context context)
// 	{
// 		ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
// 		NetworkInfo wifi_connect = connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
// 		WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
// 		WifiInfo info = wifi.getConnectionInfo();
// 		if (wifi_connect.isConnected())
// 		{
// 			return info.getSSID().toString().replaceAll("\"", "");
// 		} else
// 		{
// 			return "";
// 		}
// 	}
// }


// Path: src/com/zhongyun/viewer/video/BaseActivity.java
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.app.AlertDialog.Builder;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.ichano.rvs.viewer.constant.RvsSessionState;
import com.zhongyun.viewer.R;
import com.zhongyun.viewer.utils.Constants;
import com.zhongyun.viewer.utils.NetWorkUtil;

//			backBtn.setOnClickListener(this);
//		}
//		optBtn.setOnClickListener(this);
//		titleText.setText(titleId);
//	}

	@Override
	public void onClick(View v) {
		int id = v.getId();
		if (id == R.id.back_linlayout) {
			this.finish();
		}
	}

	public void showToast(String message) {
		Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
	}

	public void showLongToast(String message) {
		Toast.makeText(this, message, Toast.LENGTH_LONG).show();
	}

	public void showToast(int messageId) {
		Toast.makeText(this, messageId, Toast.LENGTH_SHORT).show();
	}
	int lastType = -1;
	private final BroadcastReceiver broadReceiver = new BroadcastReceiver() {
		@Override
		public void onReceive(Context context, Intent intent) {
			if (intent.getAction().equals(Constants.CONNECTIVITY_CHANGE_ACTION)) {
				int type = NetWorkUtil.netWorkIsAvailable(BaseActivity.this);