Ray Zhang il y a 12 ans
Parent
commit
45df2916a4

+ 10 - 11
Apex/AndroidManifest.xml

@@ -46,7 +46,7 @@
                 <category android:name="android.intent.category.LAUNCHER" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
             </intent-filter>
         </activity>
         </activity>
-        <activity
+<!--         <activity
             android:name="com.usai.apex.LoginFragment"
             android:name="com.usai.apex.LoginFragment"
             android:label="@string/title_activity_login"
             android:label="@string/title_activity_login"
             android:windowSoftInputMode="adjustResize|stateVisible" >
             android:windowSoftInputMode="adjustResize|stateVisible" >
@@ -54,27 +54,26 @@
         <activity
         <activity
             android:name="com.usai.apex.DirectTrackingFragment"
             android:name="com.usai.apex.DirectTrackingFragment"
             android:label="@string/title_activity_direct_tracking" >
             android:label="@string/title_activity_direct_tracking" >
-        </activity>
+        </activity> -->
         <activity
         <activity
             android:name="com.usai.apex.FunctionSelectActivity"
             android:name="com.usai.apex.FunctionSelectActivity"
-            android:label="@string/title_activity_function_select" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
+            android:label="@string/title_activity_function_select"
+            android:screenOrientation="portrait" >
         </activity>
         </activity>
         <activity
         <activity
             android:name="com.usai.apex.SearchActivity"
             android:name="com.usai.apex.SearchActivity"
-            android:label="@string/title_activity_search" >
+            android:label="@string/title_activity_search"
+            android:screenOrientation="portrait" >
         </activity>
         </activity>
         <activity
         <activity
             android:name="com.usai.apex.CustomizeFieldsActivity"
             android:name="com.usai.apex.CustomizeFieldsActivity"
-            android:label="@string/title_activity_customize_fields" >
+            android:label="@string/title_activity_customize_fields"
+            android:screenOrientation="portrait" >
         </activity>
         </activity>
         <activity
         <activity
             android:name="com.usai.apex.ResultActivity"
             android:name="com.usai.apex.ResultActivity"
-            android:label="@string/title_activity_result" >
+            android:label="@string/title_activity_result"
+            android:screenOrientation="portrait" >
         </activity>
         </activity>
     </application>
     </application>
 
 

+ 11 - 15
Apex/res/layout/activity_result.xml

@@ -33,26 +33,13 @@
     <HorizontalScrollView
     <HorizontalScrollView
         android:id="@+id/search_form"
         android:id="@+id/search_form"
         android:layout_width="wrap_content"
         android:layout_width="wrap_content"
-        android:layout_height="wrap_content" >
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/tv_head" >
 
 
         <TableLayout
         <TableLayout
             android:layout_width="wrap_content"
             android:layout_width="wrap_content"
             android:layout_height="fill_parent" >
             android:layout_height="fill_parent" >
 
 
-            <TableRow
-                android:id="@+id/tr_count"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:gravity="center_horizontal" >
-
-                <TextView
-                    android:id="@+id/textView1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Large Text"
-                    android:textAppearance="?android:attr/textAppearanceLarge" />
-            </TableRow>
-
             <TableRow
             <TableRow
                 android:id="@+id/tr_header"
                 android:id="@+id/tr_header"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
@@ -61,4 +48,13 @@
         </TableLayout>
         </TableLayout>
     </HorizontalScrollView>
     </HorizontalScrollView>
 
 
+    <TextView
+        android:id="@+id/tv_head"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentTop="true"
+        android:layout_centerHorizontal="true"
+        android:text="Show count here"
+        android:textAppearance="?android:attr/textAppearanceLarge" />
+
 </RelativeLayout>
 </RelativeLayout>

+ 9 - 5
Apex/src/com/usai/apex/ResultActivity.java

@@ -203,8 +203,7 @@ public class ResultActivity extends Activity
 					return false;
 					return false;
 				}
 				}
 			}
 			}
-			if (true)
-				return true;
+
 			String jstr = Network.get_records(user, password, searchParms);
 			String jstr = Network.get_records(user, password, searchParms);
 			if (jstr == null || jstr.length() <= 0)
 			if (jstr == null || jstr.length() <= 0)
 			{
 			{
@@ -284,6 +283,8 @@ public class ResultActivity extends Activity
 			if (success)
 			if (success)
 			{
 			{
 
 
+				TextView tv_head = (TextView) findViewById(R.id.tv_head);
+				tv_head.setText(searchresult.get_totalcount()+"");
 				// SharedPreferences.Editor editor = RunOnce.edit();
 				// SharedPreferences.Editor editor = RunOnce.edit();
 				// editor.putBoolean("FirstRun"+globalUtil.getVerName(this),
 				// editor.putBoolean("FirstRun"+globalUtil.getVerName(this),
 				// false);
 				// false);
@@ -308,8 +309,8 @@ public class ResultActivity extends Activity
 		@Override
 		@Override
 		protected void onCancelled()
 		protected void onCancelled()
 		{
 		{
-			// mAuthTask = null;
-			// showProgress(false);
+			 m_task = null;
+			 showProgress(false);
 		}
 		}
 	}
 	}
 
 
@@ -322,12 +323,15 @@ public class ResultActivity extends Activity
 
 
 		public void init_fields(String jsonfields)
 		public void init_fields(String jsonfields)
 		{
 		{
+			String TAG = "init_fields@ResultActivity.SearchResult";
+			Log.d(TAG, jsonfields);
 
 
 		}
 		}
 
 
 		public void add_records(String records)
 		public void add_records(String records)
 		{
 		{
-
+			String TAG = "init_fields@ResultActivity.SearchResult";
+			Log.d(TAG, records);
 		}
 		}
 
 
 		public int get_totalcount()
 		public int get_totalcount()

+ 1 - 0
Apex/src/com/usai/apex/SearchActivity.java

@@ -317,6 +317,7 @@ public class SearchActivity extends ListActivity implements OnClickListener
 			intent.putExtra("password", password);
 			intent.putExtra("password", password);
 			intent.putExtra("function_name", function_name);
 			intent.putExtra("function_name", function_name);
 			Bundle parms = new Bundle();
 			Bundle parms = new Bundle();
+			parms.putString("module_name",function_name);
 			Iterator iter = hashMap.keySet().iterator();
 			Iterator iter = hashMap.keySet().iterator();
 			while (iter.hasNext())
 			while (iter.hasNext())
 			{
 			{

+ 28 - 579
Apex/src/com/usai/util/Network.java

@@ -62,9 +62,9 @@ public class Network
 	public static final int BEHAVIOR_SEARCH = 0;
 	public static final int BEHAVIOR_SEARCH = 0;
 	public static final int BEHAVIOR_RESULT = 1;
 	public static final int BEHAVIOR_RESULT = 1;
 
 
-	private static final int REQUEST_TIMEOUT = 5 * 1000;// request time out 20
-														// secs
-	private static final int SO_TIMEOUT = 5 * 1000; // so time out 20 secs;
+	private static final int REQUEST_TIMEOUT = 30 * 1000;// request time out 20
+															// secs
+	private static final int SO_TIMEOUT = 30 * 1000; // so time out 20 secs;
 	public static int AP_USER_AUTH = 1;
 	public static int AP_USER_AUTH = 1;
 	public static int AP_USER_NOT_AUTH = 2;
 	public static int AP_USER_NOT_AUTH = 2;
 	public static int AP_USER_NOT_EXIST = 3;
 	public static int AP_USER_NOT_EXIST = 3;
@@ -82,114 +82,11 @@ public class Network
 	public static final int RESULT_USERAUTH_ERROR = -9;
 	public static final int RESULT_USERAUTH_ERROR = -9;
 	public static final int RESULT_UPDATE_USERAUTH_ERROR = -11;
 	public static final int RESULT_UPDATE_USERAUTH_ERROR = -11;
 	public static final int RESULT_SESSION_EXPIRED = -13;
 	public static final int RESULT_SESSION_EXPIRED = -13;
-	// public static final int RESULT_NOCONNECT = 2;
-	// public static final int RESULT_CONNECT = 3;
-	// public static final int RESULT_TIMEOUT = 4;
-	// public static final int RESULT_RESPONSE_NULL= 6;
-	// public static final int RESULT_ERR_USERAUTH= 8;
-
-	// enum RES_VERIFYUSER{RESULT_FALSE,RESULT_TRUE,}
-	// public static int PROTOCAL_FALSE = 0;
-	// public static int PROTOCAL_TRUE = 1;
-	// public static int PROTOCAL_NOT_AUTH = 2;
-	// public static int PROTOCAL_SUCCESS = 1;
-	// public static int PROTOCAL_FAILED = 1;
-	// public static int PROTOCAL_MORE=4;
-	// public static int ERR_LOCALFILE = 0;
-
-	// static String URL_JSON_TEST = "http://192.168.23.1/xampp/json_test.php";
-	// static String URL_VERIFY_USER =
-	// "http://192.168.1.10/xampp/verify_user.php";
-	// static String URL_UPLOAD_PHOTO =
-	// "http://192.168.1.10/xampp/save_upload_file.php";
-	// public static String URL_VERIFY_USER =
-	// "https://ra.apexshipping.com/login.php";
+
 	public static String URL_UPDATE_AUTH = "https://ra.apexshipping.com/login.php";
 	public static String URL_UPDATE_AUTH = "https://ra.apexshipping.com/login.php";
 	public static String URL_REQUEST_COUNT = "https://ra.apexshipping.com/main.php";
 	public static String URL_REQUEST_COUNT = "https://ra.apexshipping.com/main.php";
 	public static String URL_REQUEST_RECORDS = "https://ra.apexshipping.com/main.php";
 	public static String URL_REQUEST_RECORDS = "https://ra.apexshipping.com/main.php";
 
 
-	// public static String FAKE_URL_UPDATE_AUTH =
-	// "https://192.168.23.1/xampp/auth.json";
-	// public static String FAKE_SEARCH =
-	// "https://192.168.23.1/xampp/recordset.json";
-
-	// static String URL_UPLOAD_PHOTO =
-	// "http://192.168.23.1/xampp/save_upload_file.php";
-	//
-	// private static String fakegetJson(String url)
-	// {
-	// return download(url, 10000);
-	// // return null;
-	//
-	// }
-	//
-	// public static String download(String urlStr, int timeout)
-	// {
-	// String TAG = "net_dbg@download";
-	//
-	// Log.d(TAG, urlStr);
-	//
-	// StringBuffer sb = new StringBuffer();
-	// String line = null;
-	// BufferedReader buffer = null;
-	// HttpURLConnection urlConn = null;
-	// try
-	// {
-	// // 创建一个URL对象
-	// URL url = new URL(urlStr);
-	// // 创建一个Http连接
-	// urlConn = (HttpURLConnection) url.openConnection();
-	//
-	// urlConn.setConnectTimeout(timeout);
-	// urlConn.setReadTimeout(timeout);
-	// // urlConn.connect();
-	//
-	// int irespon = urlConn.getResponseCode();
-	// if (irespon != HttpURLConnection.HTTP_OK)
-	// {
-	// Log.e(TAG, "HTTP ERROR CODE " + irespon + " url: " + urlStr);
-	// urlConn.disconnect();
-	// return null;
-	// }
-	//
-	// // 使用IO流读取数据
-	// buffer = new BufferedReader(new InputStreamReader(
-	// urlConn.getInputStream()));
-	// while ((line = buffer.readLine()) != null)
-	// {
-	// sb.append(line);
-	// }
-	// Log.d(TAG, "download success @" + urlStr);
-	// }
-	// catch (MalformedURLException e)
-	// {
-	// // TODO Auto-generated catch block
-	// e.printStackTrace();
-	// }
-	// catch (IOException e)
-	// {
-	// // TODO Auto-generated catch block
-	// e.printStackTrace();
-	// }
-	//
-	// finally
-	// {
-	// try
-	// {
-	// if (urlConn != null)
-	// urlConn.disconnect();
-	// if (buffer != null)
-	// buffer.close();
-	// }
-	// catch (Exception e)
-	// {
-	// e.printStackTrace();
-	// }
-	//
-	// }
-	// return sb.toString();
-	// }
-
 	private static HttpClient getNewHttpClient()
 	private static HttpClient getNewHttpClient()
 	{
 	{
 		try
 		try
@@ -222,57 +119,6 @@ public class Network
 		}
 		}
 	}
 	}
 
 
-	// HttpClient getHttpsClient()
-	// {
-	// KeyStore trustStore;
-	// try
-	// {
-	// trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
-	// trustStore.load(null, null);
-	// SSLSocketFactory sf = new MySSLSocketFactory(trustStore);
-	// sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
-	//
-	// SchemeRegistry registry = new SchemeRegistry();
-	// registry.register(new Scheme("http", PlainSocketFactory
-	// .getSocketFactory(), 80));
-	// registry.register(new Scheme("https", sf, 443));
-	//
-	// ClientConnectionManager ccm = new ThreadSafeClientConnManager(
-	// params, registry);
-	// }
-	// catch (KeyStoreException e)
-	// {
-	// // TODO Auto-generated catch block
-	// e.printStackTrace();
-	// }
-	// catch (NoSuchAlgorithmException e)
-	// {
-	// // TODO Auto-generated catch block
-	// e.printStackTrace();
-	// }
-	// catch (CertificateException e)
-	// {
-	// // TODO Auto-generated catch block
-	// e.printStackTrace();
-	// }
-	// catch (IOException e)
-	// {
-	// // TODO Auto-generated catch block
-	// e.printStackTrace();
-	// }
-	// catch (KeyManagementException e)
-	// {
-	// // TODO Auto-generated catch block
-	// e.printStackTrace();
-	// }
-	// catch (UnrecoverableKeyException e)
-	// {
-	// // TODO Auto-generated catch block
-	// e.printStackTrace();
-	// }
-	//
-	// }
-
 	public static String getJson(String url, Bundle parms)
 	public static String getJson(String url, Bundle parms)
 	{
 	{
 		String TAG = "net_dbg@GetJson";
 		String TAG = "net_dbg@GetJson";
@@ -293,6 +139,7 @@ public class Network
 					HttpMultipartMode.BROWSER_COMPATIBLE);
 					HttpMultipartMode.BROWSER_COMPATIBLE);
 
 
 			Set<String> keys = parms.keySet();
 			Set<String> keys = parms.keySet();
+			Log.d(TAG, "================parms============");
 			for (String key : keys)
 			for (String key : keys)
 			{
 			{
 				if (key.contains("_file"))
 				if (key.contains("_file"))
@@ -302,8 +149,10 @@ public class Network
 				else
 				else
 					reqEntity.addPart(key, new StringBody(parms.get(key)
 					reqEntity.addPart(key, new StringBody(parms.get(key)
 							.toString()));
 							.toString()));
-
+				Log.d(TAG, "key=" + key + "    val="
+						+ parms.get(key).toString());
 			}
 			}
+			Log.d(TAG, "================parms============");
 
 
 			post.setEntity(reqEntity);
 			post.setEntity(reqEntity);
 			HttpResponse response = client.execute(post);
 			HttpResponse response = client.execute(post);
@@ -339,29 +188,7 @@ public class Network
 							return null;
 							return null;
 						}
 						}
 						return sb.toString();
 						return sb.toString();
-						// JSONObject obj = new JSONObject(sb.toString());
-						// if (obj.length() > 0)
-						// {
-						// // JSONObject obj = array.getJSONObject(0);
-						// try
-						// {
-						// int verifyresult = Integer.parseInt(obj
-						// .getString("result"));
-						// if (verifyresult == Network.AP_USER_AUTH)
-						// {
-						// return RESULT_TRUE;
-						// }
-						// else
-						// {
-						// return RESULT_FALSE;
-						// }
-						// }
-						// catch (Exception e)
-						// {
-						// Log.e(TAG, e.toString());
-						// return RESULT_ERROR;
-						// }
-						// }
+
 					}
 					}
 					catch (Exception e)
 					catch (Exception e)
 					{
 					{
@@ -453,395 +280,13 @@ public class Network
 
 
 	}
 	}
 
 
-	// public static int VerifyUser(String user, String password)
-	// {
-	// String TAG = "net_dbg@VerifyUser";
-	// Log.d(TAG, "entry");
-	// try
-	// {
-	// BasicHttpParams httpParams = new BasicHttpParams();
-	// HttpConnectionParams.setConnectionTimeout(httpParams,
-	// REQUEST_TIMEOUT);
-	// HttpConnectionParams.setSoTimeout(httpParams, SO_TIMEOUT);
-	// HttpClient client = new DefaultHttpClient(httpParams);
-	// HttpPost post = new HttpPost(URL_VERIFY_USER);
-	// MultipartEntity reqEntity = new MultipartEntity(
-	// HttpMultipartMode.BROWSER_COMPATIBLE);
-	// reqEntity.addPart("user", new StringBody(user));
-	// reqEntity.addPart("password", new StringBody(password));
-	//
-	// post.setEntity(reqEntity);
-	// HttpResponse response = client.execute(post);
-	// int statucode = response.getStatusLine().getStatusCode();
-	// if (statucode == HttpStatus.SC_OK)
-	// {
-	// HttpEntity resEntity = response.getEntity();
-	// if (resEntity != null)
-	// {
-	// Log.d(TAG,
-	// "Response: content len==>"
-	// + resEntity.getContentLength());
-	// InputStream is = resEntity.getContent();
-	// try
-	// {
-	//
-	// BufferedReader br = new BufferedReader(
-	// new InputStreamReader(is, "utf-8"), 8);
-	// StringBuilder sb = new StringBuilder();
-	// String line = null;
-	// while ((line = br.readLine()) != null)
-	// {
-	// sb.append(line + "\n");
-	// }
-	//
-	// Log.d(TAG, "Response: content begin");
-	// Log.d(TAG, sb.toString());
-	// Log.d(TAG, "Response: content end");
-	//
-	// if (sb.length() <= 0)
-	// {
-	//
-	// return RESULT_NET_ERROR;
-	// }
-	// JSONObject obj = new JSONObject(sb.toString());
-	// if (obj.length() > 0)
-	// {
-	// // JSONObject obj = array.getJSONObject(0);
-	// try
-	// {
-	// int verifyresult = Integer.parseInt(obj
-	// .getString("result"));
-	// if (verifyresult == Network.AP_USER_AUTH)
-	// {
-	// return RESULT_TRUE;
-	// }
-	// else
-	// {
-	// return RESULT_FALSE;
-	// }
-	// }
-	// catch (Exception e)
-	// {
-	// Log.e(TAG, e.toString());
-	// return RESULT_ERROR;
-	// }
-	// }
-	// }
-	// catch (Exception e)
-	// {
-	// Log.e(TAG, e.toString());
-	// return RESULT_ERROR;
-	// // TODO: handle exception
-	// }
-	// finally
-	// {
-	// is.close();
-	//
-	// }
-	//
-	// }
-	// else
-	// {
-	// /*
-	// * resEntity is null
-	// */
-	// Log.d(TAG, "RESPONSE ENTITY IS NULL");
-	// return RESULT_NET_ERROR;
-	// }
-	//
-	// }
-	// else
-	// {
-	// /*
-	// * Http error; out put error code;
-	// */
-	// Log.d(TAG, "HTTP " + statucode);
-	//
-	// HttpEntity resEntity = response.getEntity();
-	// if (resEntity != null)
-	// {
-	//
-	// InputStream is = resEntity.getContent();
-	// try
-	// {
-	//
-	// BufferedReader br = new BufferedReader(
-	// new InputStreamReader(is, "utf-8"), 8);
-	// StringBuilder sb = new StringBuilder();
-	// String line = null;
-	// while ((line = br.readLine()) != null)
-	// {
-	// sb.append(line + "\n");
-	// }
-	//
-	// Log.d(TAG, "Response: content begin");
-	// Log.d(TAG, sb.toString());
-	// Log.d(TAG, "Response: content end");
-	// return RESULT_ERROR;
-	// }
-	// catch (Exception e)
-	// {
-	// Log.e(TAG, e.toString());
-	// return RESULT_ERROR;
-	// // TODO: handle exception
-	// }
-	// finally
-	// {
-	// is.close();
-	//
-	// }
-	//
-	// }
-	// else
-	// {
-	// /*
-	// * resEntity is null
-	// */
-	// Log.e(TAG, "RESPONSE ENTITY IS NULL");
-	// return RESULT_NET_ERROR;
-	// }
-	// }
-	//
-	// }
-	// catch (ConnectTimeoutException e)
-	// {
-	// Log.d(TAG, "request time out");
-	// return RESULT_NET_ERROR;
-	//
-	// }
-	// catch (Exception e)
-	// {
-	// Log.d(TAG, e.toString());
-	// return RESULT_ERROR;
-	// }
-	// return RESULT_ERROR;
-	// }
-
-	// public static int UploadFile(String path, String user, String password,
-	// String pid)
-	// {
-	// String TAG = "net_dbg@VerifyUser";
-	// Log.d(TAG, "entry");
-	//
-	// Log.d(TAG, "sourcefile:" + path);
-	// File file = new File(path);
-	//
-	// if (file.exists() == false)
-	// return RESULT_LOCALFILE_ERROR;
-	//
-	// try
-	// {
-	// BasicHttpParams httpParams = new BasicHttpParams();
-	// HttpConnectionParams.setConnectionTimeout(httpParams,
-	// REQUEST_TIMEOUT);
-	// HttpConnectionParams.setSoTimeout(httpParams, SO_TIMEOUT);
-	// HttpClient client = new DefaultHttpClient(httpParams);
-	// HttpPost post = new HttpPost(URL_UPLOAD_PHOTO);
-	// MultipartEntity reqEntity = new MultipartEntity(
-	// HttpMultipartMode.BROWSER_COMPATIBLE);
-	// reqEntity.addPart("user", new StringBody(user));
-	// reqEntity.addPart("password", new StringBody(password));
-	// reqEntity.addPart("pid", new StringBody(pid));
-	// FileBody bin = new FileBody(file);
-	// reqEntity.addPart("imagefile", bin);
-	// post.setEntity(reqEntity);
-	// HttpResponse response = client.execute(post);
-	// int statucode = response.getStatusLine().getStatusCode();
-	// if (statucode == HttpStatus.SC_OK)
-	// {
-	// HttpEntity resEntity = response.getEntity();
-	// if (resEntity != null)
-	// {
-	// Log.d(TAG,
-	// "Response: content len==>"
-	// + resEntity.getContentLength());
-	// InputStream is = resEntity.getContent();
-	// try
-	// {
-	//
-	// BufferedReader br = new BufferedReader(
-	// new InputStreamReader(is, "utf-8"), 8);
-	// StringBuilder sb = new StringBuilder();
-	// String line = null;
-	// while ((line = br.readLine()) != null)
-	// {
-	// sb.append(line + "\n");
-	// }
-	//
-	// Log.d(TAG, "Response: content begin");
-	// Log.d(TAG, sb.toString());
-	// Log.d(TAG, "Response: content end");
-	//
-	// if (sb.length() <= 0)
-	// {
-	//
-	// return RESULT_NET_ERROR;
-	// }
-	// JSONObject obj = new JSONObject(sb.toString());
-	// if (obj.length() > 0)
-	// {
-	// // JSONObject obj = array.getJSONObject(0);
-	// try
-	// {
-	// int uploadresult = Integer.parseInt(obj
-	// .getString("result"));
-	// if (uploadresult == Network.AP_UPLOAD_SUCCESS)
-	// {
-	// return RESULT_TRUE;
-	// }
-	// else
-	// if (uploadresult == Network.AP_USER_NOT_AUTH)
-	// {
-	// Log.d(TAG, "RESULT_ERR_USERAUTH");
-	// return RESULT_USERAUTH_ERROR;
-	// }
-	// else
-	// {
-	// return RESULT_FALSE;
-	// }
-	// }
-	// catch (Exception e)
-	// {
-	// Log.e(TAG, e.toString());
-	// return RESULT_FALSE;
-	// }
-	// }
-	// }
-	// catch (Exception e)
-	// {
-	// Log.e(TAG, e.toString());
-	// return RESULT_ERROR;
-	// // TODO: handle exception
-	// }
-	// finally
-	// {
-	// is.close();
-	//
-	// }
-	//
-	// }
-	// else
-	// {
-	// /*
-	// * resEntity is null
-	// */
-	// Log.d(TAG, "RESPONSE ENTITY IS NULL");
-	// return RESULT_NET_ERROR;
-	// }
-	//
-	// }
-	// else
-	// {
-	// /*
-	// * Http error; out put error code;
-	// */
-	// Log.d(TAG, "HTTP " + statucode);
-	//
-	// HttpEntity resEntity = response.getEntity();
-	// if (resEntity != null)
-	// {
-	//
-	// InputStream is = resEntity.getContent();
-	// try
-	// {
-	//
-	// BufferedReader br = new BufferedReader(
-	// new InputStreamReader(is, "utf-8"), 8);
-	// StringBuilder sb = new StringBuilder();
-	// String line = null;
-	// while ((line = br.readLine()) != null)
-	// {
-	// sb.append(line + "\n");
-	// }
-	//
-	// Log.d(TAG, "Response: content begin");
-	// Log.d(TAG, sb.toString());
-	// Log.d(TAG, "Response: content end");
-	// return RESULT_ERROR;
-	// }
-	// catch (Exception e)
-	// {
-	// Log.e(TAG, e.toString());
-	// return RESULT_ERROR;
-	// // TODO: handle exception
-	// }
-	// finally
-	// {
-	// is.close();
-	//
-	// }
-	//
-	// }
-	// else
-	// {
-	// /*
-	// * resEntity is null
-	// */
-	// Log.e(TAG, "RESPONSE ENTITY IS NULL");
-	// return RESULT_NET_ERROR;
-	// }
-	// }
-	//
-	// }
-	// catch (ConnectTimeoutException e)
-	// {
-	// Log.d(TAG, "request time out");
-	// return RESULT_NET_ERROR;
-	//
-	// }
-	// catch (Exception e)
-	// {
-	// Log.d(TAG, e.toString());
-	// return RESULT_ERROR;
-	// }
-	//
-	// return RESULT_FALSE;
-	//
-	// // try
-	// // {
-	// // HttpClient client = new DefaultHttpClient();
-	// // HttpPost post = new HttpPost(url);
-	// // MultipartEntity reqEntity = new MultipartEntity(
-	// // HttpMultipartMode.BROWSER_COMPATIBLE);
-	// // reqEntity.addPart("user", new StringBody(user));
-	// // reqEntity.addPart("password", new StringBody(password));
-	// // reqEntity.addPart("pid", new StringBody(pid));
-	// // FileBody bin = new FileBody(file);
-	// // reqEntity.addPart("imagefile", bin);
-	// // post.setEntity(reqEntity);
-	// // HttpResponse response = client.execute(post);
-	// // HttpEntity resEntity = response.getEntity();
-	// // if (resEntity != null)
-	// // {
-	// //
-	// // String result = EntityUtils.toString(resEntity);
-	// // Log.d(TAG, "Response:" + result);
-	// // return Integer.parseInt(result);
-	// // // if(Boolean.parseBoolean(result)==true)
-	// // // return true;
-	// // // else
-	// // // return false;
-	// // }
-	// //
-	// // }
-	// // catch (Exception e)
-	// // {
-	// // e.printStackTrace();
-	// // }
-	// // return 0;
-	// }
 	public static int get_recordcount(String name, String password, Bundle parms)
 	public static int get_recordcount(String name, String password, Bundle parms)
 	{
 	{
 		String TAG = "net_dbg@get_recordcount";
 		String TAG = "net_dbg@get_recordcount";
-		// parms.putString("user", name);
-		// parms.putString("password", password);
-		// if (!Network.NetworkIsAvailable())
-		// {
-		// Log.d(TAG, "network not available!");
-		// return Network.RESULT_NET_NOTAVAILABLE; // network not available
-		// }
+
 		parms.putString("action", "handset_search_count");
 		parms.putString("action", "handset_search_count");
 		parms.putString("sessionid", ApexTrackingApplication.get_sessionid());
 		parms.putString("sessionid", ApexTrackingApplication.get_sessionid());
+		Log.d(TAG, "sessionid=" + ApexTrackingApplication.get_sessionid());
 		String jstr = getJson(Network.URL_REQUEST_COUNT, parms);
 		String jstr = getJson(Network.URL_REQUEST_COUNT, parms);
 		if (jstr == null || jstr.length() <= 0)
 		if (jstr == null || jstr.length() <= 0)
 		{
 		{
@@ -926,19 +371,23 @@ public class Network
 				if (jsobj.getInt("result") != Network.AP_USER_AUTH)
 				if (jsobj.getInt("result") != Network.AP_USER_AUTH)
 				{
 				{
 					// session expired
 					// session expired
-					if (get_Auth(name, password) == RESULT_TRUE)
-					{
-						return get_records(name, password, parms);
-
-					}
-					else
-					{
-
-						Log.d(TAG,
-								"USER NOT AUTHORIZED CODE="
-										+ jsobj.getInt("result"));
-						return null;
-					}
+					Log.d(TAG,
+							"USER NOT AUTHORIZED CODE="
+									+ jsobj.getInt("result"));
+					return null;
+					// if (get_Auth(name, password) == RESULT_TRUE)
+					// {
+					// return get_records(name, password, parms);
+					//
+					// }
+					// else
+					// {
+					//
+					// Log.d(TAG,
+					// "USER NOT AUTHORIZED CODE="
+					// + jsobj.getInt("result"));
+					// return null;
+					// }
 				}
 				}
 				else
 				else
 				{
 				{