Index: /issm/mobile/android/ISSM_APP/AndroidManifest.xml
===================================================================
--- /issm/mobile/android/ISSM_APP/AndroidManifest.xml	(revision 17619)
+++ /issm/mobile/android/ISSM_APP/AndroidManifest.xml	(revision 17620)
@@ -66,5 +66,5 @@
         <activity
             android:name="gov.nasa.jpl.issm.ISSMWebActivity"
-            android:label="@string/title_activity_issmweb_online" android:configChanges="orientation|screenSize">
+            android:label="@string/title_activity_issmweb_online" android:screenOrientation="landscape">
         </activity>
     </application>
Index: /issm/mobile/android/ISSM_APP/bin/AndroidManifest.xml
===================================================================
--- /issm/mobile/android/ISSM_APP/bin/AndroidManifest.xml	(revision 17619)
+++ /issm/mobile/android/ISSM_APP/bin/AndroidManifest.xml	(revision 17620)
@@ -66,5 +66,5 @@
         <activity
             android:name="gov.nasa.jpl.issm.ISSMWebActivity"
-            android:label="@string/title_activity_issmweb_online" android:configChanges="orientation|screenSize">
+            android:label="@string/title_activity_issmweb_online" android:screenOrientation="landscape">
         </activity>
     </application>
Index: /issm/mobile/android/ISSM_APP/src/gov/nasa/jpl/issm/ISSMAPP.java
===================================================================
--- /issm/mobile/android/ISSM_APP/src/gov/nasa/jpl/issm/ISSMAPP.java	(revision 17619)
+++ /issm/mobile/android/ISSM_APP/src/gov/nasa/jpl/issm/ISSMAPP.java	(revision 17620)
@@ -14,5 +14,7 @@
 import android.os.AsyncTask;
 import android.os.Bundle;
+import android.os.CountDownTimer;
 import android.os.Environment;
+import android.os.Handler;
 import android.util.Log;
 import android.view.Window;
@@ -43,92 +45,26 @@
 		setContentView(R.layout.splashscreen);
 		settings = this.getSharedPreferences("MenuPage", 0);
-		final ConnectivityManager conMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
-		if (conMgr.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED
-				|| conMgr.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED) {
-
-			// temporary: display modes without messing with the network to
-			// be able to access offline mode
-			// AlertDialog.Builder builder = new AlertDialog.Builder(this);
-			// builder.setMessage("Pick a mode");
-			// CharSequence[] options = { "Native", "Offline", "Online" };
-			// builder.setItems(options, new DialogInterface.OnClickListener() {
-			// public void onClick(DialogInterface dialog, int which) {
-			// switch (which) {
-			// case 0:
-			// boolean firstrun = settings.getBoolean(
-			// PREFERENCE_FIRST_RUN, true);
-			// extStorageDirectory = Environment
-			// .getExternalStorageDirectory().toString();
-			// issmFolder = extStorageDirectory + "/ISSM/input_files/";
-			// imageList = new ImageList(ISSMAPP.this);
-			// new CopyDataTask().execute(firstrun);
-			// break;
-			// case 1:
-			// Intent j = new Intent(ISSMAPP.this,
-			// ISSMWebActivity.class);
-			// j.putExtra("mode", 1);
-			// startActivity(j);
-			// finish();
-			// break;
-			// case 2:
-			// Intent i = new Intent(ISSMAPP.this,
-			// ISSMWebActivity.class);
-			// i.putExtra("mode", 0);
-			// startActivity(i);
-			// finish();
-			// break;
-			// }
-			// }
-			// });
-			// builder.create().show();
-			new AlertDialog.Builder(this)
-					.setMessage("Pick a mode")
-					.setCancelable(false)
-					.setPositiveButton("Online",
-							new DialogInterface.OnClickListener() {
-								public void onClick(DialogInterface dialog,
-										int id) {
-									Intent i = new Intent(ISSMAPP.this,
-											ISSMWebActivity.class);
-									i.putExtra("mode", 0);
-									startActivity(i);
-									finish();
-								}
-							})
-					.setNeutralButton("Offline",
-							new DialogInterface.OnClickListener() {
-								public void onClick(DialogInterface dialog,
-										int id) {
-									Intent i = new Intent(ISSMAPP.this,
-											ISSMWebActivity.class);
-									i.putExtra("mode", 1);
-									startActivity(i);
-									finish();
-								}
-							})
-					.setNegativeButton("Native",
-							new DialogInterface.OnClickListener() {
-								public void onClick(DialogInterface dialog,
-										int id) {
-									boolean firstrun = settings.getBoolean(
-											PREFERENCE_FIRST_RUN, true);
-									extStorageDirectory = Environment
-											.getExternalStorageDirectory()
-											.toString();
-									issmFolder = extStorageDirectory
-											+ "/ISSM/input_files/";
-									imageList = new ImageList(ISSMAPP.this);
-									new CopyDataTask().execute(firstrun);
-								}
-							}).show();
-
-		} else {
-			boolean firstrun = settings.getBoolean(PREFERENCE_FIRST_RUN, true);
-			extStorageDirectory = Environment.getExternalStorageDirectory()
-					.toString();
-			issmFolder = extStorageDirectory + "/ISSM/input_files/";
-			imageList = new ImageList(this);
-			new CopyDataTask().execute(firstrun);
-		}
+		new Handler().postDelayed(new Runnable() {
+			@Override
+			public void run() {
+				// This method will be executed once the timer is over
+				final ConnectivityManager conMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
+				if (conMgr.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED
+						|| conMgr.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED) {
+					Intent i = new Intent(ISSMAPP.this, ISSMWebActivity.class);
+					i.putExtra("mode", 0);
+					startActivity(i);
+					finish();
+				} else {
+
+					boolean firstrun = settings.getBoolean(
+							PREFERENCE_FIRST_RUN, true);
+					extStorageDirectory = Environment
+							.getExternalStorageDirectory().toString();
+					issmFolder = extStorageDirectory + "/ISSM/input_files/";
+					new CopyMapTask().execute(firstrun);
+				}
+			}
+		}, 2000);
 	}
 
@@ -174,4 +110,48 @@
 			i.putExtra("pathToFile", issmFolder);
 			startActivity(i);
+		}
+	}
+
+	// -----------------------------------------------------------------------
+	private class CopyMapTask extends AsyncTask<Boolean, Void, Boolean> {
+		@Override
+		protected Boolean doInBackground(Boolean... target) {
+			// imageList.decodeAndResizeImageFromURL();
+			// imageList.decodeAndResizeImage();
+			// imageList.decodeLargeImage();
+			// not sure why, but target[0] can be true on install! more to be
+			// done.
+			// if(target[0] = false)
+			// {
+			SharedPreferences.Editor e = settings.edit();
+			e.putBoolean(PREFERENCE_FIRST_RUN, false);
+
+			e.commit();
+			// If not, run these methods:
+			SetDirectory(issmFolder);
+			// }
+			return true;
+		}
+
+		@Override
+		protected void onPreExecute() {
+			progressDialog = new ProgressDialog(ISSMAPP.this);
+			progressDialog.setMessage("No connection detected. Loading offline mode");
+			progressDialog.setIndeterminate(true);
+			progressDialog.setCancelable(false);
+			progressDialog.show();
+		}
+
+		protected void onPostExecute(Boolean result) {
+			progressDialog.dismiss();
+			// Log.i("imageList size: ",
+			// String.valueOf(ImageList.getImageList().size()));
+			// Log.i("largeImageList size: ",
+			// String.valueOf(ImageList.getLargeImages().size()));
+			Intent i = new Intent(ISSMAPP.this, ISSMWebActivity.class);
+			i.putExtra("pathToFile", issmFolder);
+			i.putExtra("mode", 1);
+			startActivity(i);
+			finish();
 		}
 	}
Index: /issm/mobile/android/ISSM_APP/src/gov/nasa/jpl/issm/ISSMWebActivity.java
===================================================================
--- /issm/mobile/android/ISSM_APP/src/gov/nasa/jpl/issm/ISSMWebActivity.java	(revision 17619)
+++ /issm/mobile/android/ISSM_APP/src/gov/nasa/jpl/issm/ISSMWebActivity.java	(revision 17620)
@@ -1,12 +1,12 @@
 package gov.nasa.jpl.issm;
 
-import android.net.NetworkInfo;
+import java.net.URI;
+
 import android.os.Bundle;
+import android.os.Handler;
 import android.app.ActionBar;
 import android.app.Activity;
 import android.app.AlertDialog;
-import android.app.ProgressDialog;
 import android.content.DialogInterface;
-import android.content.Intent;
 import android.util.Log;
 import android.view.Menu;
@@ -14,4 +14,5 @@
 import android.view.View;
 import android.view.View.OnClickListener;
+import android.webkit.WebResourceResponse;
 import android.webkit.WebView;
 import android.widget.Button;
@@ -20,7 +21,8 @@
 
 	// URL of the index page of the ISSM web application
-	private String srcPath = "http://issm.jpl.nasa.gov/externalicelab/index.html";
+	private String srcPath = "++";
 	private String offPath = "file:///android_asset/externalicelab/index.html";
 	private final String KEY = "mode";
+	private String issmFolder = "";
 	private int MODE;
 	// private String srcPath =
@@ -69,16 +71,109 @@
 		myWebView = (WebView) findViewById(R.id.issmWeb);
 		myWebView.setWebViewClient(new MyWebViewClient() {
-			// @Override
-			// public boolean shouldOverrideUrlLoading(WebView view, String url)
-			// {
-			// loading.show();
-			// return false;
-			// }
-			//
-			// @Override
-			// public void onPageFinished(WebView view, String url) {
-			// // hide loading
-			// loading.dismiss();
-			// }
+
+			@Override
+			public boolean shouldOverrideUrlLoading(WebView view, String url) {
+				if (MODE != 0) {
+					if (url.startsWith("http")
+							&& !url.contains("http://thwaites.jpl.nasa.gov/fastcgi/visl-solve.py?callbacks")) {
+						myWebView.setVisibility(View.INVISIBLE);
+						new AlertDialog.Builder(ISSMWebActivity.this)
+								.setTitle("Error!")
+								.setMessage(
+										"Option requires online mode. Please exit and enable connection to access the option.")
+								.setCancelable(false)
+								.setPositiveButton("Okay",
+										new DialogInterface.OnClickListener() {
+											public void onClick(
+													DialogInterface dialog,
+													int id) {
+												myWebView.loadUrl(offPath);
+												new Handler().postDelayed(
+														new Runnable() {
+															@Override
+															public void run() {
+																// This method
+																// will be
+																// executed once
+																// the timer is
+																// over
+																myWebView
+																		.setVisibility(View.VISIBLE);
+															}
+														}, 700);
+											}
+										}).show();
+					}
+				}
+				return false;
+			}
+
+			@Override
+			public WebResourceResponse shouldInterceptRequest(WebView view,
+					String url) {
+				Log.i("QUERY URL: ", url);
+				if (url.contains("http://thwaites.jpl.nasa.gov/fastcgi/visl-solve.py?callback")) {
+					new AlertDialog.Builder(ISSMWebActivity.this)
+							.setTitle("Yes!")
+							.setMessage("Caught server request sucessfully.")
+							.setCancelable(false)
+							.setPositiveButton("Okay",
+									new DialogInterface.OnClickListener() {
+										public void onClick(
+												DialogInterface dialog, int id) {
+
+										}
+									}).show();
+
+				}
+				// temporary created to avoid compile error. This will cause app
+				// to crash at one point during runtime
+				return null;
+
+				// URI uri = URI.create(url);
+				// String scheme = uri.getScheme();
+				// // If scheme not http(s), let the default webview manage it
+				// if (!"http".equals(scheme) && !"https".equals(scheme)) {
+				// return null;
+				// }
+
+				// URL url = uri.toURL();
+				//
+				// if(doCancelRequest(url)) {
+				// // Empty response
+				// Log.d(TAG, "URL filtered: " + url);
+				// return new WebResourceResponse("text/plain", "UTF-8", new
+				// EmptyInputStream());
+				//
+				// } else {
+				// Log.d(TAG, "URL: " + url);
+				//
+				// HttpURLConnection conn = (HttpURLConnection)
+				// url.openConnection();
+				// conn.setRequestProperty("User-Agent",
+				// mSettings.getUserAgentString());
+				//
+				// // Configure connections
+				// configureConnection(conn);
+				//
+				// String mimeType = conn.getContentType();
+				// String encoding = conn.getContentEncoding();
+				//
+				// if(mimeType != null && mimeType.contains(CONTENT_TYPE_SPLIT))
+				// {
+				// String[] split = mimeType.split(CONTENT_TYPE_SPLIT);
+				// mimeType = split[0];
+				//
+				// Matcher matcher = CONTENT_TYPE_PATTERN.matcher(split[1]);
+				// if(matcher.find()) {
+				// encoding = matcher.group(1);
+				// }
+				// }
+				//
+				// InputStream is = conn.getInputStream();
+				// return new WebResourceResponse(mimeType, encoding, is);
+				// return null;
+				// }
+			}
 		});
 		myWebView.getSettings().setJavaScriptEnabled(true);
@@ -89,4 +184,5 @@
 			myWebView.loadUrl(srcPath);
 		} else {
+			issmFolder = getIntent().getExtras().getString("pathToFile");
 			myWebView.loadUrl(offPath);
 		}
@@ -142,4 +238,3 @@
 						}).setNegativeButton("No", null).show();
 	}
-
 }
Index: /issm/mobile/android/ISSM_APP/src/gov/nasa/jpl/issm/MyWebViewClient.java
===================================================================
--- /issm/mobile/android/ISSM_APP/src/gov/nasa/jpl/issm/MyWebViewClient.java	(revision 17619)
+++ /issm/mobile/android/ISSM_APP/src/gov/nasa/jpl/issm/MyWebViewClient.java	(revision 17620)
@@ -2,4 +2,5 @@
 
 import android.view.View;
+import android.webkit.WebResourceResponse;
 import android.webkit.WebView;
 import android.webkit.WebViewClient;
@@ -20,3 +21,7 @@
 	}
 
+	public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
+		return null;
+	}
+
 }
