+catch Exception
This commit is contained in:
@ -10,7 +10,6 @@ import android.util.Log;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Spinner;
|
||||
import java.sql.SQLException;
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -75,6 +74,8 @@ public class DBGUITable
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb != null) { rdb.close(); }
|
||||
}
|
||||
@ -121,6 +122,8 @@ public class DBGUITable
|
||||
}while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (rdb != null) { rdb.close(); }
|
||||
}
|
||||
@ -303,6 +306,8 @@ public class DBGUITable
|
||||
}
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb != null) { rdb.close(); }
|
||||
}
|
||||
|
||||
@ -1588,12 +1588,14 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.v(tableName, e.toString(), e);
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
} finally
|
||||
{
|
||||
if (c != null)
|
||||
c.close();
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb != null) { rdb.close(); }
|
||||
}
|
||||
@ -1603,6 +1605,8 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
/**Функция для обновления или вставки табличных данных*/
|
||||
public Boolean updateTable(TCTable tbl)
|
||||
{
|
||||
if(tbl==null) return false;
|
||||
|
||||
Cursor cursor;
|
||||
if(tbl.name.equals("countries"))
|
||||
Log.i("igor", "tbl0=" + tbl.name);
|
||||
@ -1624,88 +1628,102 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
}
|
||||
}
|
||||
|
||||
SQLiteDatabase wdb = null;
|
||||
try {
|
||||
wdb = this.getWritableDatabase();
|
||||
//Переписываем значения существующих полей и выполняем запросы
|
||||
while(tbl.ReadNextRecord())
|
||||
//Переписываем значения существующих полей и выполняем запросы
|
||||
while(tbl.ReadNextRecord())
|
||||
{
|
||||
if(tbl.name.equals("frmlocustdel")){
|
||||
Log.i("igor","tbl.name="+tbl.name);
|
||||
}
|
||||
String sql="select 1 from "+tbl.name+" where id = ?";
|
||||
String[] par = new String[] { tbl.getRowByName("id").getStrVal() };
|
||||
|
||||
boolean exists=false;
|
||||
SQLiteDatabase rdb=null;
|
||||
try {
|
||||
rdb = getReadableDatabase();
|
||||
cursor = rdb.rawQuery(sql, par);
|
||||
exists=cursor.moveToFirst();
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb != null) { rdb.close(); }
|
||||
}
|
||||
|
||||
ContentValues cv = new ContentValues();
|
||||
for(int i=0;i<tbl.fields.size();i++)
|
||||
{
|
||||
if(tbl.name.equals("frmlocustdel")){
|
||||
Log.i("igor","tbl.name="+tbl.name);
|
||||
}
|
||||
String sql="select 1 from "+tbl.name+" where id = ?";
|
||||
String[] par = new String[] { tbl.getRowByName("id").getStrVal() };
|
||||
//if(b && tbl.fields.get(i).name.equals("id")) continue; //Если существует не записываем
|
||||
//Log.i("igor","fld="+tbl.fields.get(i).name+" val="+tbl.fields.get(i).getStrVal()+" type="+tbl.fields.get(i).type); //Для дебага
|
||||
|
||||
boolean exists=false;
|
||||
SQLiteDatabase rdb=null;
|
||||
if(fb[i]) //Присваиваем только поля существующие в локальной базе
|
||||
{
|
||||
if(tbl.fields.get(i).value==null)
|
||||
cv.putNull(tbl.fields.get(i).name);
|
||||
else
|
||||
cv.put(tbl.fields.get(i).name, tbl.fields.get(i).getStrVal());
|
||||
}
|
||||
}
|
||||
|
||||
if(!exists)
|
||||
{
|
||||
SQLiteDatabase wdb = null;
|
||||
try {
|
||||
rdb = getReadableDatabase();
|
||||
cursor = rdb.rawQuery(sql, par);
|
||||
exists=cursor.moveToFirst();
|
||||
cursor.close();
|
||||
}finally{
|
||||
if(rdb != null) { rdb.close(); }
|
||||
}
|
||||
|
||||
ContentValues cv = new ContentValues();
|
||||
for(int i=0;i<tbl.fields.size();i++)
|
||||
{
|
||||
//if(b && tbl.fields.get(i).name.equals("id")) continue; //Если существует не записываем
|
||||
Log.i("igor","fld="+tbl.fields.get(i).name+" val="+tbl.fields.get(i).getStrVal()+" type="+tbl.fields.get(i).type); //Для дебага
|
||||
|
||||
if(fb[i]) //Присваиваем только поля существующие в локальной базе
|
||||
{
|
||||
if(tbl.fields.get(i).value==null)
|
||||
cv.putNull(tbl.fields.get(i).name);
|
||||
else
|
||||
cv.put(tbl.fields.get(i).name, tbl.fields.get(i).getStrVal());
|
||||
}
|
||||
}
|
||||
|
||||
if(!exists)
|
||||
{
|
||||
wdb = this.getWritableDatabase();
|
||||
wdb.beginTransaction(); //Вроде как защита от многопоточности (для сервиса)
|
||||
try {
|
||||
wdb.insert(tbl.name, null, cv);
|
||||
wdb.setTransactionSuccessful();
|
||||
}catch(SQLException ex){
|
||||
}catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
}finally {
|
||||
wdb.endTransaction();
|
||||
}
|
||||
}else
|
||||
{
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(wdb!=null){ wdb.close(); }
|
||||
}
|
||||
}else
|
||||
{
|
||||
SQLiteDatabase wdb = null;
|
||||
try {
|
||||
wdb = this.getWritableDatabase();
|
||||
wdb.beginTransaction(); //Вроде как защита от многопоточности (для сервиса)
|
||||
try {
|
||||
wdb.update(tbl.name, cv, "id = ?", new String[] { tbl.getRowByName("id").getStrVal() });
|
||||
wdb.setTransactionSuccessful();
|
||||
}catch(SQLException ex){
|
||||
}catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
} finally {
|
||||
wdb.endTransaction();
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(wdb!=null){ wdb.close(); }
|
||||
}
|
||||
}
|
||||
}finally{
|
||||
if(wdb!=null){ wdb.close(); }
|
||||
}
|
||||
|
||||
|
||||
//Для дебага
|
||||
SQLiteDatabase rdb=null;
|
||||
try {
|
||||
rdb=getReadableDatabase();
|
||||
cursor = rdb.rawQuery("select sum(1) s from " + tbl.name, null);
|
||||
if (cursor.moveToFirst()) {
|
||||
do {
|
||||
Log.i("igor", "tbl1=" + tbl.name + " cnt=" + cursor.getString(cursor.getColumnIndex("s")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}finally{
|
||||
if(rdb!=null) rdb.close();
|
||||
}
|
||||
/**/
|
||||
//Для дебага вывожу сколько строк в каждой таблице
|
||||
// SQLiteDatabase rdb=null;
|
||||
// try {
|
||||
// rdb = getReadableDatabase();
|
||||
// cursor = rdb.rawQuery("select sum(1) cnt from " + tbl.name, null);
|
||||
// if (cursor.moveToFirst()) {
|
||||
// do {
|
||||
// Log.i("igor", "tbl1=" + tbl.name + " cnt=" + cursor.getString(0));
|
||||
// } while (cursor.moveToNext());
|
||||
// }
|
||||
// cursor.close();
|
||||
// }catch(Exception e){
|
||||
// e.printStackTrace();
|
||||
// }finally{
|
||||
// if(rdb!=null) rdb.close();
|
||||
// }
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1752,10 +1770,13 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
}
|
||||
wdb.setTransactionSuccessful();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
//e.printStackTrace();
|
||||
} finally {
|
||||
wdb.endTransaction();
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(wdb!=null){ wdb.close(); }
|
||||
}
|
||||
@ -1775,6 +1796,8 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
Cursor cursor = rdb.rawQuery("select 1 from _user where id = ?", new String[]{String.valueOf(id)});
|
||||
b = cursor.moveToFirst();
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null) rdb.close();
|
||||
}
|
||||
@ -1797,9 +1820,13 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
try {
|
||||
wdb.insert("_user", null, cv);
|
||||
wdb.setTransactionSuccessful();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
wdb.endTransaction();
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(wdb!=null){ wdb.close(); }
|
||||
}
|
||||
@ -1821,9 +1848,13 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
try {
|
||||
wdb.update("_user", cv, "id = ?", new String[] { String.valueOf(id) });
|
||||
wdb.setTransactionSuccessful();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
wdb.endTransaction();
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(wdb!=null){ wdb.close(); }
|
||||
}
|
||||
@ -2005,6 +2036,8 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
try {
|
||||
db.insert("frmlocustdel", null, cv);
|
||||
db.setTransactionSuccessful();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
@ -2253,7 +2286,8 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
//e.printStackTrace();
|
||||
}
|
||||
|
||||
} while (cursor.moveToNext());
|
||||
|
||||
@ -74,7 +74,6 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
public Long seq = null; // Дата изменения записи секунд с 1970 года
|
||||
public StringDB m_Filled = new StringDB("1"); // 1- все обяз. поля заполнены, 0 - не все обяз. поля заполнены
|
||||
//public Long created = null; // Дата создания записи секунд с 1970 года (только для не синхронизированных записей на планшете)
|
||||
|
||||
//public Integer user_id = null;
|
||||
|
||||
public String ImageName = null; // Название файла рисунка
|
||||
@ -263,6 +262,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -303,6 +304,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -446,6 +449,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -467,6 +472,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -487,6 +494,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -522,6 +531,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -558,6 +569,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -579,6 +592,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -599,6 +614,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -619,6 +636,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -640,6 +659,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -675,6 +696,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -695,6 +718,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -715,6 +740,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -740,6 +767,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -760,6 +789,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -822,6 +853,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -847,6 +880,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -866,6 +901,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -1462,7 +1499,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
|
||||
} catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
//e.printStackTrace();
|
||||
}
|
||||
// Для сохранения названия рисунка в базу
|
||||
break;
|
||||
@ -1928,6 +1966,8 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -2595,11 +2635,15 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
stmt.bindDouble(4, list.get(i).lat);
|
||||
stmt.bindDouble(5, list.get(i).lon);
|
||||
stmt.executeInsert();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(wdb!=null){ wdb.close(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -2656,19 +2700,19 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
DbOpenHelper dboh = new DbOpenHelper(this);
|
||||
SQLiteDatabase rdb = null;
|
||||
try {
|
||||
rdb = dboh.getReadableDatabase();
|
||||
Cursor cursor = rdb.rawQuery("select * from terminals where del=0 and serial='"+ Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID)+"';", null);
|
||||
String sql="select * from terminals where del=0 and serial='"+ Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID)+"';";
|
||||
try(
|
||||
SQLiteDatabase rdb = dboh.getReadableDatabase();
|
||||
Cursor cursor = rdb.rawQuery(sql, null);
|
||||
) {
|
||||
if(!cursor.moveToFirst())
|
||||
{
|
||||
Toast toast = Toast.makeText(getApplicationContext(),
|
||||
getResources().getString(R.string.Please_authorize_the_tablet), Toast.LENGTH_LONG);
|
||||
toast.show();
|
||||
}
|
||||
cursor.close();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
} catch (Exception e) {
|
||||
Log.e("CCALM", "Database error occurred", e);
|
||||
}
|
||||
dboh.close();
|
||||
}
|
||||
|
||||
@ -26,6 +26,7 @@ import android.provider.Settings;
|
||||
import android.provider.Settings.Secure;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
@ -309,6 +310,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -339,6 +342,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -410,6 +415,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -436,6 +443,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -463,6 +472,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -497,6 +508,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -522,6 +535,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -575,6 +590,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -597,6 +614,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -621,6 +640,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -645,6 +666,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -669,6 +692,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -691,6 +716,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -746,6 +773,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -770,6 +799,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -792,6 +823,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -816,6 +849,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -840,6 +875,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -864,6 +901,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -923,6 +962,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -982,6 +1023,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -1012,6 +1055,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -1217,6 +1262,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -1751,7 +1798,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
|
||||
} catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
//e.printStackTrace();
|
||||
}
|
||||
// Для сохранения названия рисунка в базу
|
||||
break;
|
||||
@ -1871,11 +1919,15 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
stmt.bindString(5, list.get(i).uid);
|
||||
stmt.executeInsert();
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(wdb!=null){ wdb.close(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -1957,6 +2009,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -2484,6 +2538,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
toast.show();
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.SQLException;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@ -169,6 +168,8 @@ public class LocustDelListActivity extends AppCompatActivity
|
||||
try {
|
||||
wdb = dboh.getWritableDatabase();
|
||||
wdb.execSQL("delete from frmlocustdel where send=1");
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if(wdb!=null){ wdb.close(); }
|
||||
}
|
||||
@ -685,6 +686,8 @@ public class LocustDelListActivity extends AppCompatActivity
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -711,6 +714,8 @@ public class LocustDelListActivity extends AppCompatActivity
|
||||
toast.show();
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
|
||||
@ -20,6 +20,7 @@ import android.os.Environment;
|
||||
import android.provider.Settings.Secure;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
@ -386,6 +387,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -415,6 +418,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -505,6 +510,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -533,6 +540,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -584,6 +593,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -611,6 +622,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -643,6 +656,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -689,6 +704,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -713,6 +730,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -738,6 +757,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -763,6 +784,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -788,6 +811,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -811,6 +836,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -838,6 +865,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -863,6 +892,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -888,6 +919,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -912,6 +945,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -937,6 +972,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -1005,6 +1042,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -1107,6 +1146,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -3206,7 +3247,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
|
||||
} catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
//e.printStackTrace();
|
||||
}
|
||||
// Для сохранения названия рисунка в базу
|
||||
break;
|
||||
|
||||
@ -165,6 +165,8 @@ public class LocustHealthListActivity extends AppCompatActivity
|
||||
try {
|
||||
rdb = dboh.getReadableDatabase();
|
||||
rdb.execSQL("delete from frmlocusthealth where send=1");
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -746,6 +748,8 @@ public class LocustHealthListActivity extends AppCompatActivity
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -772,6 +776,8 @@ public class LocustHealthListActivity extends AppCompatActivity
|
||||
toast.show();
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
|
||||
@ -163,6 +163,8 @@ public class LocustListActivity extends AppCompatActivity
|
||||
try {
|
||||
rdb = dboh.getReadableDatabase();
|
||||
rdb.execSQL("delete from frmlocust where send=1");
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -650,6 +652,8 @@ public class LocustListActivity extends AppCompatActivity
|
||||
}
|
||||
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -674,6 +678,8 @@ public class LocustListActivity extends AppCompatActivity
|
||||
toast.show();
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
|
||||
@ -77,7 +77,8 @@ public class MainActivity extends Activity {
|
||||
sslContext.createSSLEngine();
|
||||
} catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException
|
||||
| NoSuchAlgorithmException | KeyManagementException e) {
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
}
|
||||
|
||||
//Загрузка сохранёного языка
|
||||
@ -144,7 +145,8 @@ public class MainActivity extends Activity {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -186,7 +188,8 @@ public class MainActivity extends Activity {
|
||||
try {
|
||||
((TextView) findViewById(R.id.tvVersion)).setText("v "+this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionName);
|
||||
} catch (NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
}
|
||||
|
||||
//Для синхронизации справочников
|
||||
@ -214,6 +217,8 @@ public class MainActivity extends Activity {
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
|
||||
@ -76,7 +76,8 @@ public class MainService extends Service
|
||||
m_pi.send(MainService.this, SetupActivity.STATUS_FINISH, intent);
|
||||
} catch (CanceledException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,6 +183,8 @@ public class MapsActivity extends FragmentActivity implements OnMapReadyCallback
|
||||
}
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
|
||||
@ -125,7 +125,8 @@ public class MySynchronizationNew
|
||||
mSemaphore.acquire();
|
||||
mTList.add(tableName);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
} finally
|
||||
{ mSemaphore.release();
|
||||
}
|
||||
@ -139,7 +140,8 @@ public class MySynchronizationNew
|
||||
mSemaphore.acquire();
|
||||
result=mTList.size();
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
} finally
|
||||
{ mSemaphore.release();
|
||||
}
|
||||
@ -299,6 +301,8 @@ public class MySynchronizationNew
|
||||
try {
|
||||
db.update("frmlocust", cv, "uid = ?", new String[] { String.valueOf(cursor.getString(cursor.getColumnIndex("uid"))) });
|
||||
db.setTransactionSuccessful();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
@ -317,6 +321,8 @@ public class MySynchronizationNew
|
||||
try {
|
||||
db.update("frmlocust", cv, "uid = ?", new String[] { String.valueOf(cursor.getString(cursor.getColumnIndex("uid"))) });
|
||||
db.setTransactionSuccessful();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
@ -335,6 +341,8 @@ public class MySynchronizationNew
|
||||
try {
|
||||
db.update("frmlocust", cv, "uid = ?", new String[] { String.valueOf(cursor.getString(cursor.getColumnIndex("uid"))) });
|
||||
db.setTransactionSuccessful();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
@ -370,6 +378,8 @@ public class MySynchronizationNew
|
||||
try {
|
||||
db.update("frmlocust", cv, "uid = ?", new String[] { String.valueOf(uid) });
|
||||
db.setTransactionSuccessful();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
|
||||
@ -250,6 +250,8 @@ public class MySynchronizationOld
|
||||
}while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -358,6 +360,8 @@ public class MySynchronizationOld
|
||||
}while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -417,6 +421,8 @@ public class MySynchronizationOld
|
||||
}while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -437,6 +443,8 @@ public class MySynchronizationOld
|
||||
}
|
||||
if (seq == null) seq = "0";
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -475,6 +483,8 @@ public class MySynchronizationOld
|
||||
}while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -493,6 +503,8 @@ public class MySynchronizationOld
|
||||
}while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -552,6 +564,8 @@ public class MySynchronizationOld
|
||||
rid_frmlocustdel_locations = makeRequest("frmlocustdel_locations",String.valueOf(MySynchronizationOld.SyncDays),country_id);
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -665,6 +679,8 @@ public class MySynchronizationOld
|
||||
try {
|
||||
wdb.update("frmlocust", cv, "uid = ?", new String[]{String.valueOf(uid)});
|
||||
wdb.setTransactionSuccessful();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
wdb.endTransaction();
|
||||
}
|
||||
@ -693,6 +709,8 @@ public class MySynchronizationOld
|
||||
pFile.renameTo(new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Pictures/Locust/_" + cursor.getString(cursor.getColumnIndex("image_name3"))));
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
if(wdb!=null){ wdb.close(); }
|
||||
@ -720,6 +738,8 @@ public class MySynchronizationOld
|
||||
try {
|
||||
wdb.update("frmlocustdel", cv, "uid = ?", new String[]{String.valueOf(uid)});
|
||||
wdb.setTransactionSuccessful();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
wdb.endTransaction();
|
||||
}
|
||||
@ -748,6 +768,8 @@ public class MySynchronizationOld
|
||||
pFile.renameTo(new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Pictures/Locust/_" + cursor.getString(cursor.getColumnIndex("image_name3"))));
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
if(wdb!=null){ wdb.close(); }
|
||||
@ -832,8 +854,9 @@ class MyThread extends Thread
|
||||
}
|
||||
}
|
||||
|
||||
} catch (InterruptedException ex)
|
||||
} catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
} finally
|
||||
{ mSemaphore.release();
|
||||
}
|
||||
@ -963,12 +986,14 @@ class MyThread extends Thread
|
||||
try {
|
||||
dos.write(buffer, 0, bytesRead);
|
||||
} catch (OutOfMemoryError e) {
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
}
|
||||
bytesRead = fileInputStream.read(buffer);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
}
|
||||
fileInputStream.close();
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@ import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
import android.view.Display;
|
||||
import android.view.SurfaceHolder;
|
||||
@ -138,6 +139,8 @@ public class ScanActivity extends Activity {
|
||||
tvName.setText(cursor.getString(cursor.getColumnIndex("name")));
|
||||
}
|
||||
cursor.close();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
@ -201,7 +204,8 @@ public class ScanActivity extends Activity {
|
||||
try {
|
||||
inputStream = getContentResolver().openInputStream(data.getData());
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
}
|
||||
if (inputStream != null) {
|
||||
|
||||
@ -276,6 +280,8 @@ public class ScanActivity extends Activity {
|
||||
stmt.bindString(5, Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID));
|
||||
stmt.executeInsert();
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
if(wdb!=null){ wdb.close(); }
|
||||
@ -298,7 +304,8 @@ public class ScanActivity extends Activity {
|
||||
qrcode = "";
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -327,7 +334,8 @@ public class ScanActivity extends Activity {
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
Log.e("CCALM", "Error: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -384,6 +384,8 @@ public class SetupActivity extends Activity {
|
||||
wdb = dboh.getWritableDatabase();
|
||||
dboh.dropAllTables(wdb);
|
||||
dboh.onCreate(wdb);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(wdb!=null){ wdb.close(); }
|
||||
}
|
||||
|
||||
@ -25,6 +25,8 @@ public class SplashScreen extends Activity {
|
||||
SQLiteDatabase rdb = null;
|
||||
try {
|
||||
rdb = dboh.getReadableDatabase();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(rdb!=null){ rdb.close(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user