// Path: android/android/gen/edu/cmu/cs/cloudlet/android/R.java
// public final class R {
//     public static final class attr {
//     }
//     public static final class drawable {
//         public static final int ic_launcher=0x7f020000;
//     }
//     public static final class id {
//         public static final int camera_preview=0x7f060000;
//         public static final int cancel_button=0x7f06000a;
//         public static final int container=0x7f060007;
//         public static final int current_dir_text=0x7f060009;
//         public static final int dialog_list_item_title=0x7f060005;
//         public static final int fluid_textView=0x7f06000c;
//         public static final int fluidgl_view=0x7f06000d;
//         public static final int linearLayout1=0x7f060008;
//         public static final int login_status_message=0x7f060003;
//         public static final int relativeLayout1=0x7f060006;
//         public static final int sendButton=0x7f060001;
//         public static final int startBatchTest=0x7f060015;
//         public static final int synthesisFromOpenStack=0x7f060014;
//         public static final int testAsia=0x7f060012;
//         public static final int testCloudlet=0x7f06000e;
//         public static final int testEU=0x7f060011;
//         public static final int testEast=0x7f06000f;
//         public static final int testSynthesis=0x7f060013;
//         public static final int testWest=0x7f060010;
//         public static final int use_this_dir_button=0x7f06000b;
//         public static final int webProgress=0x7f060002;
//         public static final int webView=0x7f060004;
//     }
//     public static final class layout {
//         public static final int camera=0x7f030000;
//         public static final int custom_progress=0x7f030001;
//         public static final int dialog_list_item=0x7f030002;
//         public static final int filebrowser=0x7f030003;
//         public static final int graphics=0x7f030004;
//         public static final int graphics_main=0x7f030005;
//         public static final int main=0x7f030006;
//         public static final int main_reserach=0x7f030007;
//         public static final int test_main=0x7f030008;
//     }
//     public static final class string {
//         public static final int app_name=0x7f050000;
//         public static final int synthesis_button_title=0x7f050002;
//         public static final int synthesis_config_memu_clear=0x7f050004;
//         public static final int synthesis_config_memu_setting=0x7f050003;
//         public static final int synthesis_label_title=0x7f050001;
//     }
//     public static final class xml {
//         public static final int preferences=0x7f040000;
//     }
// }


import java.io.File;
import java.util.ArrayList;
import java.util.Vector;
import org.apache.http.util.ByteArrayBuffer;
import org.json.JSONException;
import org.json.JSONObject;
import edu.cmu.cs.cloudlet.android.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import android.widget.TextView;

		public void handleMessage(Message msg) {
			if (msg.what == GNetworkClient.CONNECTION_ERROR) {
				String message = msg.getData().getString("message");
				showAlertDialog(message);
			} else if (msg.what == GNetworkClient.NETWORK_ERROR) {
				if (networkClient != null) {
					networkClient.close();
				}
				String message = msg.getData().getString("message");
				showAlertDialog(message);
			} else if (msg.what == GNetworkClient.PROGRESS_MESSAGE) {
				Bundle data = msg.getData();
				activity.updateData(msg.obj);				
				if(messageUpdateRateCount++ % 10 ==0){
					activity.updateLog(data.getString("message"));
				}	
			} else if (msg.what == GNetworkClient.FINISH_MESSAGE){
				Bundle data = msg.getData();
//				activity.updateLog(data.getString("message") + "\n");
				if (networkClient != null) {
					networkClient.close();
				}
				showAlertDialog("Finish");
			}
		}
	};

	private void showAlertDialog(String errorMsg) {
		if (activity.isFinishing() == false) {
			new AlertDialog.Builder(mContext).setTitle("Info")

// Path: android/android/gen/edu/cmu/cs/cloudlet/android/R.java
// public final class R {
//     public static final class attr {
//     }
//     public static final class drawable {
//         public static final int ic_launcher=0x7f020000;
//     }
//     public static final class id {
//         public static final int camera_preview=0x7f060000;
//         public static final int cancel_button=0x7f06000a;
//         public static final int container=0x7f060007;
//         public static final int current_dir_text=0x7f060009;
//         public static final int dialog_list_item_title=0x7f060005;
//         public static final int fluid_textView=0x7f06000c;
//         public static final int fluidgl_view=0x7f06000d;
//         public static final int linearLayout1=0x7f060008;
//         public static final int login_status_message=0x7f060003;
//         public static final int relativeLayout1=0x7f060006;
//         public static final int sendButton=0x7f060001;
//         public static final int startBatchTest=0x7f060015;
//         public static final int synthesisFromOpenStack=0x7f060014;
//         public static final int testAsia=0x7f060012;
//         public static final int testCloudlet=0x7f06000e;
//         public static final int testEU=0x7f060011;
//         public static final int testEast=0x7f06000f;
//         public static final int testSynthesis=0x7f060013;
//         public static final int testWest=0x7f060010;
//         public static final int use_this_dir_button=0x7f06000b;
//         public static final int webProgress=0x7f060002;
//         public static final int webView=0x7f060004;
//     }
//     public static final class layout {
//         public static final int camera=0x7f030000;
//         public static final int custom_progress=0x7f030001;
//         public static final int dialog_list_item=0x7f030002;
//         public static final int filebrowser=0x7f030003;
//         public static final int graphics=0x7f030004;
//         public static final int graphics_main=0x7f030005;
//         public static final int main=0x7f030006;
//         public static final int main_reserach=0x7f030007;
//         public static final int test_main=0x7f030008;
//     }
//     public static final class string {
//         public static final int app_name=0x7f050000;
//         public static final int synthesis_button_title=0x7f050002;
//         public static final int synthesis_config_memu_clear=0x7f050004;
//         public static final int synthesis_config_memu_setting=0x7f050003;
//         public static final int synthesis_label_title=0x7f050001;
//     }
//     public static final class xml {
//         public static final int preferences=0x7f040000;
//     }
// }


// Path: android/android_fluid/src/edu/cmu/cs/cloudlet/android/application/graphics/GNetworkClient.java
import java.io.File;
import java.util.ArrayList;
import java.util.Vector;
import org.apache.http.util.ByteArrayBuffer;
import org.json.JSONException;
import org.json.JSONObject;
import edu.cmu.cs.cloudlet.android.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import android.widget.TextView;

		public void handleMessage(Message msg) {
			if (msg.what == GNetworkClient.CONNECTION_ERROR) {
				String message = msg.getData().getString("message");
				showAlertDialog(message);
			} else if (msg.what == GNetworkClient.NETWORK_ERROR) {
				if (networkClient != null) {
					networkClient.close();
				}
				String message = msg.getData().getString("message");
				showAlertDialog(message);
			} else if (msg.what == GNetworkClient.PROGRESS_MESSAGE) {
				Bundle data = msg.getData();
				activity.updateData(msg.obj);				
				if(messageUpdateRateCount++ % 10 ==0){
					activity.updateLog(data.getString("message"));
				}	
			} else if (msg.what == GNetworkClient.FINISH_MESSAGE){
				Bundle data = msg.getData();
//				activity.updateLog(data.getString("message") + "\n");
				if (networkClient != null) {
					networkClient.close();
				}
				showAlertDialog("Finish");
			}
		}
	};

	private void showAlertDialog(String errorMsg) {
		if (activity.isFinishing() == false) {
			new AlertDialog.Builder(mContext).setTitle("Info")

					.setIcon(R.drawable.ic_launcher).setMessage(errorMsg)
