|
|
@@ -61,7 +61,7 @@ public class Network
|
|
|
{
|
|
|
public static final int BEHAVIOR_SEARCH = 0;
|
|
|
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;
|
|
|
@@ -74,13 +74,14 @@ public class Network
|
|
|
public static int AP_UPLOAD_FAIL = 5;
|
|
|
//
|
|
|
public static final int RESULT_FALSE = 0;
|
|
|
- public static final int RESULT_TRUE = 1;
|
|
|
- public static final int RESULT_NET_ERROR = 3;
|
|
|
- public static final int RESULT_NET_NOTAVAILABLE = 4;
|
|
|
- public static final int RESULT_ERROR = 5;
|
|
|
- public static final int RESULT_LOCALFILE_ERROR = 7;
|
|
|
- public static final int RESULT_USERAUTH_ERROR = 9;
|
|
|
- public static final int RESULT_UPDATE_USERAUTH_ERROR = 11;
|
|
|
+ public static final int RESULT_TRUE = -1;
|
|
|
+ public static final int RESULT_NET_ERROR = -3;
|
|
|
+ public static final int RESULT_NET_NOTAVAILABLE = -4;
|
|
|
+ public static final int RESULT_ERROR = -5;
|
|
|
+ public static final int RESULT_LOCALFILE_ERROR = -7;
|
|
|
+ public static final int RESULT_USERAUTH_ERROR = -9;
|
|
|
+ public static final int RESULT_UPDATE_USERAUTH_ERROR = -11;
|
|
|
+ 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;
|
|
|
@@ -101,89 +102,93 @@ public class Network
|
|
|
// "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_VERIFY_USER =
|
|
|
+ // "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 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";
|
|
|
+ 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 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()
|
|
|
{
|
|
|
@@ -273,8 +278,8 @@ public class Network
|
|
|
String TAG = "net_dbg@GetJson";
|
|
|
Log.d(TAG, "entry");
|
|
|
|
|
|
-// if (true)
|
|
|
-// return fakegetJson(url);
|
|
|
+ // if (true)
|
|
|
+ // return fakegetJson(url);
|
|
|
try
|
|
|
{
|
|
|
// BasicHttpParams httpParams = new BasicHttpParams();
|
|
|
@@ -825,30 +830,142 @@ public class Network
|
|
|
// // }
|
|
|
// // return 0;
|
|
|
// }
|
|
|
- public static String get_count(String name,String password,Bundle parms)
|
|
|
+ public static int get_recordcount(String name, String password, Bundle parms)
|
|
|
{
|
|
|
- String TAG = "net_dbg@get_count";
|
|
|
-// 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
|
|
|
- }
|
|
|
+ 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("sessionid", ApexTrackingApplication.get_sessionid());
|
|
|
String jstr = getJson(Network.URL_REQUEST_COUNT, parms);
|
|
|
if (jstr == null || jstr.length() <= 0)
|
|
|
{
|
|
|
Log.d(TAG, "json is wrong");
|
|
|
- return "Network.RESULT_NET_ERROR";
|
|
|
+ return Network.RESULT_NET_ERROR;
|
|
|
}
|
|
|
- return jstr;
|
|
|
+ JSONObject jsobj;
|
|
|
+
|
|
|
+ // array = new JSONArray(json);
|
|
|
+ try
|
|
|
+ {
|
|
|
+ jsobj = new JSONObject(jstr);
|
|
|
+ if (jsobj.length() > 0)
|
|
|
+ {
|
|
|
+ if (jsobj.getInt("result") != Network.AP_USER_AUTH)
|
|
|
+ {
|
|
|
+ // session expired
|
|
|
+ Log.d(TAG,
|
|
|
+ "USER NOT AUTHORIZED CODE="
|
|
|
+ + jsobj.getInt("result"));
|
|
|
+ return RESULT_SESSION_EXPIRED;
|
|
|
+ // if (get_Auth(name, password) == RESULT_TRUE)
|
|
|
+ // {
|
|
|
+ // return get_recordcount(name, password, parms);
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ //
|
|
|
+ // Log.d(TAG,
|
|
|
+ // "USER NOT AUTHORIZED CODE="
|
|
|
+ // + jsobj.getInt("result"));
|
|
|
+ // return RESULT_SESSION_EXPIRED;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return jsobj.getInt("count");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Log.d(TAG, "json is wrong");
|
|
|
+ return Network.RESULT_NET_ERROR;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (JSONException e)
|
|
|
+ {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ return RESULT_ERROR;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static String get_records(String name, String password, Bundle parms)
|
|
|
+ {
|
|
|
+ String TAG = "net_dbg@get_records";
|
|
|
+ // 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");
|
|
|
+ parms.putString("sessionid", ApexTrackingApplication.get_sessionid());
|
|
|
+ String jstr = getJson(Network.URL_REQUEST_RECORDS, parms);
|
|
|
+ if (jstr == null || jstr.length() <= 0)
|
|
|
+ {
|
|
|
+ Log.d(TAG, "json is wrong");
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ JSONObject jsobj;
|
|
|
+ //
|
|
|
+ // array = new JSONArray(json);
|
|
|
+ try
|
|
|
+ {
|
|
|
+ jsobj = new JSONObject(jstr);
|
|
|
+ if (jsobj.length() > 0)
|
|
|
+ {
|
|
|
+ if (jsobj.getInt("result") != Network.AP_USER_AUTH)
|
|
|
+ {
|
|
|
+ // 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return jstr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Log.d(TAG, "json is wrong");
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (JSONException e)
|
|
|
+ {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+
|
|
|
+ // return RESULT_ERROR;
|
|
|
}
|
|
|
+
|
|
|
public static int get_Auth(String name, String password)
|
|
|
{
|
|
|
|
|
|
String TAG = "net_dbg@get_Auth";
|
|
|
- Log.d(TAG,"u:"+name+";p:"+password);
|
|
|
+ Log.d(TAG, "u:" + name + ";p:" + password);
|
|
|
if (!Network.NetworkIsAvailable())
|
|
|
{
|
|
|
Log.d(TAG, "network not available!");
|
|
|
@@ -873,13 +990,13 @@ public class Network
|
|
|
return Network.RESULT_NET_ERROR;
|
|
|
}
|
|
|
|
|
|
- return parse_authinfo(jstr,name);
|
|
|
+ return parse_authinfo(jstr, name);
|
|
|
}
|
|
|
|
|
|
- private static int parse_authinfo(String json,String user)
|
|
|
+ private static int parse_authinfo(String json, String user)
|
|
|
{
|
|
|
String TAG = "net_dbg@parse_authinfo";
|
|
|
- Log.d(TAG,json);
|
|
|
+ Log.d(TAG, json);
|
|
|
// JSONArray array;
|
|
|
JSONObject jsobj;
|
|
|
SQLiteDatabase db = null;
|
|
|
@@ -911,6 +1028,7 @@ public class Network
|
|
|
// server;
|
|
|
ApexTrackingApplication.put_sessionid(objheader
|
|
|
.getString("sessionid"));
|
|
|
+ Log.d(TAG, "sessionid=" + objheader.getString("sessionid"));
|
|
|
// JSONObject objupdate = array.getJSONObject(3); // whether
|
|
|
// need
|
|
|
// update ;
|
|
|
@@ -931,78 +1049,94 @@ public class Network
|
|
|
editor.putInt("AuthInfoVer", objheader.getInt("ver"));
|
|
|
JSONObject objfuncs = jsobj.getJSONObject("functions");
|
|
|
Iterator it = objfuncs.keys();
|
|
|
- db = dbUtil.OpenDB(ApexTrackingApplication
|
|
|
- .get_instance(), null, true);
|
|
|
+ db = dbUtil.OpenDB(ApexTrackingApplication.get_instance(),
|
|
|
+ null, true);
|
|
|
String sql = "insert into fields_info(name,aname,field_type,function_name,behavior,priority,show,user) values(?,?,?,?,?,?,?,?)";
|
|
|
- db.execSQL("update fields_info set abandon = 1 where user ='"+user+"'");
|
|
|
- SQLiteStatement stat = db.compileStatement(sql);
|
|
|
+ db.execSQL("update fields_info set abandon = 1 where user ='"
|
|
|
+ + user + "'");
|
|
|
+ SQLiteStatement stat = db.compileStatement(sql);
|
|
|
db.beginTransaction();
|
|
|
- String field_name,field_type,alias_name;
|
|
|
+ String field_name, field_type, alias_name;
|
|
|
while (it.hasNext()) // loop for each function
|
|
|
{
|
|
|
String func_name = (String) it.next();
|
|
|
-
|
|
|
+
|
|
|
// Set<String> funset = new HashSet<String>();
|
|
|
JSONObject objfun = objfuncs.getJSONObject(func_name);
|
|
|
- int behavior,priority=999;
|
|
|
+ int behavior, priority = 999;
|
|
|
int show = 1;
|
|
|
JSONObject objbehavior = objfun.getJSONObject("search");
|
|
|
Iterator itbehavior = objbehavior.keys();
|
|
|
behavior = BEHAVIOR_SEARCH;
|
|
|
- while(itbehavior.hasNext()) //loop for search fields in certain function
|
|
|
+ while (itbehavior.hasNext()) // loop for search fields in
|
|
|
+ // certain function
|
|
|
{
|
|
|
String field = (String) itbehavior.next();
|
|
|
- JSONObject field_info = objbehavior.getJSONObject(field);
|
|
|
+ JSONObject field_info = objbehavior
|
|
|
+ .getJSONObject(field);
|
|
|
field_name = field_info.getString("name");
|
|
|
field_type = field_info.getString("type");
|
|
|
alias_name = field_info.getString("alias");
|
|
|
- int id=dbUtil.get_recordid(db, "fields_info", "name='"+field_name+"' and behavior="+behavior+" and function_name='"+func_name+"' and user='"+user+"'");
|
|
|
- if(id>=0) // record exist;
|
|
|
+ int id = dbUtil.get_recordid(db, "fields_info",
|
|
|
+ "name='" + field_name + "' and behavior="
|
|
|
+ + behavior + " and function_name='"
|
|
|
+ + func_name + "' and user='" + user
|
|
|
+ + "'");
|
|
|
+ if (id >= 0) // record exist;
|
|
|
{
|
|
|
- db.execSQL("update fields_info set abandon = 0 where _id ="+id);
|
|
|
+ db.execSQL("update fields_info set abandon = 0 where _id ="
|
|
|
+ + id);
|
|
|
}
|
|
|
- else {
|
|
|
- stat.bindString(1, field_name);
|
|
|
- stat.bindString(2, alias_name);
|
|
|
- stat.bindString(3, field_type);
|
|
|
- stat.bindString(4, func_name);
|
|
|
- stat.bindLong(5, behavior);
|
|
|
- stat.bindLong(6, priority);
|
|
|
- stat.bindLong(7, show);
|
|
|
- stat.bindString(8, user);
|
|
|
- stat.executeInsert();
|
|
|
+ else
|
|
|
+ {
|
|
|
+ stat.bindString(1, field_name);
|
|
|
+ stat.bindString(2, alias_name);
|
|
|
+ stat.bindString(3, field_type);
|
|
|
+ stat.bindString(4, func_name);
|
|
|
+ stat.bindLong(5, behavior);
|
|
|
+ stat.bindLong(6, priority);
|
|
|
+ stat.bindLong(7, show);
|
|
|
+ stat.bindString(8, user);
|
|
|
+ stat.executeInsert();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
objbehavior = objfun.getJSONObject("result");
|
|
|
Iterator itresult = objbehavior.keys();
|
|
|
behavior = BEHAVIOR_RESULT;
|
|
|
- while(itresult.hasNext()) //loop for result fields in certain function
|
|
|
+ while (itresult.hasNext()) // loop for result fields in
|
|
|
+ // certain function
|
|
|
{
|
|
|
String field = (String) itresult.next();
|
|
|
- JSONObject field_info = objbehavior.getJSONObject(field);
|
|
|
+ JSONObject field_info = objbehavior
|
|
|
+ .getJSONObject(field);
|
|
|
field_name = field_info.getString("name");
|
|
|
field_type = field_info.getString("type");
|
|
|
alias_name = field_info.getString("alias");
|
|
|
- int id=dbUtil.get_recordid(db, "fields_info", "name='"+field_name+"' and behavior="+behavior+" and function_name='"+func_name+"' and user='"+user+"'");
|
|
|
- if(id>=0) // record exist;
|
|
|
+ int id = dbUtil.get_recordid(db, "fields_info",
|
|
|
+ "name='" + field_name + "' and behavior="
|
|
|
+ + behavior + " and function_name='"
|
|
|
+ + func_name + "' and user='" + user
|
|
|
+ + "'");
|
|
|
+ if (id >= 0) // record exist;
|
|
|
{
|
|
|
- db.execSQL("update fields_info set abandon = 0 where _id ="+id);
|
|
|
+ db.execSQL("update fields_info set abandon = 0 where _id ="
|
|
|
+ + id);
|
|
|
}
|
|
|
- else {
|
|
|
- stat.bindString(1, field_name);
|
|
|
- stat.bindString(2, alias_name);
|
|
|
- stat.bindString(3, field_type);
|
|
|
- stat.bindString(4, func_name);
|
|
|
- stat.bindLong(5, behavior);
|
|
|
- stat.bindLong(6, priority);
|
|
|
- stat.bindLong(7, show);
|
|
|
- stat.bindString(8, user);
|
|
|
- stat.executeInsert();
|
|
|
+ else
|
|
|
+ {
|
|
|
+ stat.bindString(1, field_name);
|
|
|
+ stat.bindString(2, alias_name);
|
|
|
+ stat.bindString(3, field_type);
|
|
|
+ stat.bindString(4, func_name);
|
|
|
+ stat.bindLong(5, behavior);
|
|
|
+ stat.bindLong(6, priority);
|
|
|
+ stat.bindLong(7, show);
|
|
|
+ stat.bindString(8, user);
|
|
|
+ stat.executeInsert();
|
|
|
}
|
|
|
}
|
|
|
-// editor.putString(func_name, objfun.toString());
|
|
|
+ // editor.putString(func_name, objfun.toString());
|
|
|
// JSONArray arrfun = jsobj.get(i);
|
|
|
// JSONObject objname = arrfun.getJSONObject(0);
|
|
|
//
|
|
|
@@ -1022,9 +1156,9 @@ public class Network
|
|
|
// }
|
|
|
}
|
|
|
db.execSQL("delete from fields_info where abandon = 1");
|
|
|
- db.setTransactionSuccessful();
|
|
|
- db.endTransaction();
|
|
|
- editor.commit();
|
|
|
+ db.setTransactionSuccessful();
|
|
|
+ db.endTransaction();
|
|
|
+ editor.commit();
|
|
|
return RESULT_TRUE;
|
|
|
}
|
|
|
Log.d(TAG, "json is wrong");
|