СДЕЛАЛ РЕЛИЗ НА GOOGLE PLAY
This commit is contained in:
@ -15,7 +15,7 @@ android {
|
|||||||
minSdkVersion 15
|
minSdkVersion 15
|
||||||
versionCode 101
|
versionCode 101
|
||||||
versionName "3.0.0"
|
versionName "3.0.0"
|
||||||
targetSdkVersion 33
|
targetSdkVersion 34
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
Binary file not shown.
@ -11,10 +11,11 @@
|
|||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 100,
|
"versionCode": 101,
|
||||||
"versionName": "2.4.4",
|
"versionName": "3.0.0",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"elementType": "File"
|
"elementType": "File",
|
||||||
|
"minSdkVersionForDexing": 15
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
|||||||
db.execSQL(sql);
|
db.execSQL(sql);
|
||||||
|
|
||||||
//Список стран
|
//Список стран
|
||||||
sql = "create table if not exists Countries(" +
|
sql = "create table if not exists countries(" +
|
||||||
"id integer NOT NULL PRIMARY KEY," +
|
"id integer NOT NULL PRIMARY KEY," +
|
||||||
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
||||||
"del boolean NOT NULL DEFAULT 0," +
|
"del boolean NOT NULL DEFAULT 0," +
|
||||||
@ -135,7 +135,7 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
|||||||
db.execSQL(sql);
|
db.execSQL(sql);
|
||||||
|
|
||||||
//Список регионов для стран
|
//Список регионов для стран
|
||||||
sql = "create table if not exists CountriesRegions(" +
|
sql = "create table if not exists countriesregions(" +
|
||||||
"id integer NOT NULL PRIMARY KEY," +
|
"id integer NOT NULL PRIMARY KEY," +
|
||||||
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
||||||
"del boolean NOT NULL DEFAULT 0," +
|
"del boolean NOT NULL DEFAULT 0," +
|
||||||
@ -151,7 +151,7 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
|||||||
db.execSQL(sql);
|
db.execSQL(sql);
|
||||||
|
|
||||||
//Коордионаты границы для региона
|
//Коордионаты границы для региона
|
||||||
/*sql = "create table if not exists CountriesRegionsPoints(" +
|
/*sql = "create table if not exists countriesregionspoints(" +
|
||||||
"id integer NOT NULL PRIMARY KEY AUTOINCREMENT," +
|
"id integer NOT NULL PRIMARY KEY AUTOINCREMENT," +
|
||||||
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
||||||
"del boolean NOT NULL DEFAULT 0," +
|
"del boolean NOT NULL DEFAULT 0," +
|
||||||
@ -164,7 +164,7 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
|||||||
db.execSQL(sql);*/
|
db.execSQL(sql);*/
|
||||||
|
|
||||||
//Виды саранчи
|
//Виды саранчи
|
||||||
sql = "create table if not exists LocustsTypes(" +
|
sql = "create table if not exists locuststypes(" +
|
||||||
"id integer NOT NULL PRIMARY KEY," +
|
"id integer NOT NULL PRIMARY KEY," +
|
||||||
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
||||||
"del boolean NOT NULL DEFAULT 0," +
|
"del boolean NOT NULL DEFAULT 0," +
|
||||||
@ -175,7 +175,7 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
|||||||
db.execSQL(sql);
|
db.execSQL(sql);
|
||||||
|
|
||||||
//Справочник отрождения "Начало", "Массовое".
|
//Справочник отрождения "Начало", "Массовое".
|
||||||
sql = "create table if not exists Borns(" +
|
sql = "create table if not exists borns(" +
|
||||||
"id integer NOT NULL PRIMARY KEY," +
|
"id integer NOT NULL PRIMARY KEY," +
|
||||||
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
||||||
"del boolean NOT NULL DEFAULT 0," +
|
"del boolean NOT NULL DEFAULT 0," +
|
||||||
@ -186,7 +186,7 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
|||||||
db.execSQL(sql);
|
db.execSQL(sql);
|
||||||
|
|
||||||
//Справочник окрыление.
|
//Справочник окрыление.
|
||||||
sql = "create table if not exists Fledgling(" +
|
sql = "create table if not exists fledgling(" +
|
||||||
"id integer NOT NULL PRIMARY KEY," +
|
"id integer NOT NULL PRIMARY KEY," +
|
||||||
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
||||||
"del boolean NOT NULL DEFAULT 0," +
|
"del boolean NOT NULL DEFAULT 0," +
|
||||||
@ -219,7 +219,7 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
|||||||
db.execSQL(sql);
|
db.execSQL(sql);
|
||||||
|
|
||||||
//Опрыскиватели: "Трактор", "Самолёт" итд.
|
//Опрыскиватели: "Трактор", "Самолёт" итд.
|
||||||
sql = "create table if not exists Sprayers(" +
|
sql = "create table if not exists sprayers(" +
|
||||||
"id integer NOT NULL PRIMARY KEY," +
|
"id integer NOT NULL PRIMARY KEY," +
|
||||||
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
|
||||||
"del boolean NOT NULL DEFAULT 0," +
|
"del boolean NOT NULL DEFAULT 0," +
|
||||||
@ -628,7 +628,7 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
|||||||
"insecticide_formulation_id integer," + //формуляция(1 - УМО, 2 - КЭ, 3 - др.)
|
"insecticide_formulation_id integer," + //формуляция(1 - УМО, 2 - КЭ, 3 - др.)
|
||||||
"insecticide_dose float," + //норма расхода(л/га)
|
"insecticide_dose float," + //норма расхода(л/га)
|
||||||
"insecticide_diluted_id integer," +
|
"insecticide_diluted_id integer," +
|
||||||
"insecticide_Proportion float," +
|
"insecticide_proportion float," +
|
||||||
"insecticide_rate float," + //расход рабочей жидкости(л/га)
|
"insecticide_rate float," + //расход рабочей жидкости(л/га)
|
||||||
"insecticide_used_volume float," + //Общий объем использованной рабочей жидкости (л)
|
"insecticide_used_volume float," + //Общий объем использованной рабочей жидкости (л)
|
||||||
"insecticide_number_spores float," + //Концентрация спор (/мл) (--------- В 2024 ссказали удалить поэтому не используется ---------)
|
"insecticide_number_spores float," + //Концентрация спор (/мл) (--------- В 2024 ссказали удалить поэтому не используется ---------)
|
||||||
|
|||||||
@ -48,6 +48,15 @@ public class LocustDelListActivity extends AppCompatActivity
|
|||||||
|
|
||||||
public String android_id="";
|
public String android_id="";
|
||||||
|
|
||||||
|
private final Handler handler = new Handler();
|
||||||
|
private final Runnable runnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
updateList();
|
||||||
|
handler.postDelayed(this, 1000); // Раз в секунду
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public void alert(String text)
|
public void alert(String text)
|
||||||
{
|
{
|
||||||
AlertDialog.Builder adb = new AlertDialog.Builder(this,R.style.AlertDialogTheme);
|
AlertDialog.Builder adb = new AlertDialog.Builder(this,R.style.AlertDialogTheme);
|
||||||
@ -115,24 +124,7 @@ public class LocustDelListActivity extends AppCompatActivity
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Чтоб список обновлялся раз в минуту в соответствии с текущем фильтром (для наглядности отправки данных)
|
//Чтоб список обновлялся раз в минуту в соответствии с текущем фильтром (для наглядности отправки данных)
|
||||||
timer.scheduleAtFixedRate(new TimerTask()
|
handler.post(runnable); // Начинаем выполнение задачи
|
||||||
{
|
|
||||||
@SuppressLint("HandlerLeak")
|
|
||||||
private Handler myHandle = new Handler() {
|
|
||||||
@Override
|
|
||||||
public void handleMessage(Message msg)
|
|
||||||
{
|
|
||||||
//onStart();
|
|
||||||
updateList();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
myHandle.sendMessage(myHandle.obtainMessage());
|
|
||||||
}
|
|
||||||
}, 0, 1000 ); //Раз в секунду
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -623,8 +615,8 @@ public class LocustDelListActivity extends AppCompatActivity
|
|||||||
cursor = rdb.rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0 and send=1 and device_id='"+android_id+"'", null); //Отправленные
|
cursor = rdb.rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0 and send=1 and device_id='"+android_id+"'", null); //Отправленные
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//cursor = rdb.rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0 and device_id='"+android_id+"'", null); //Все
|
cursor = rdb.rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0 and device_id='"+android_id+"'", null); //Все
|
||||||
cursor = rdb.rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0", null); //Все
|
//cursor = rdb.rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0", null); //Все
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,15 @@ public class LocustHealthListActivity extends AppCompatActivity
|
|||||||
private Timer timer = new Timer();
|
private Timer timer = new Timer();
|
||||||
public File file = null;
|
public File file = null;
|
||||||
|
|
||||||
|
private final Handler handler = new Handler();
|
||||||
|
private final Runnable runnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
updateList();
|
||||||
|
handler.postDelayed(this, 1000); // Раз в секунду
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public void alert(String text)
|
public void alert(String text)
|
||||||
{
|
{
|
||||||
AlertDialog.Builder adb = new AlertDialog.Builder(this,R.style.AlertDialogTheme);
|
AlertDialog.Builder adb = new AlertDialog.Builder(this,R.style.AlertDialogTheme);
|
||||||
@ -112,24 +121,7 @@ public class LocustHealthListActivity extends AppCompatActivity
|
|||||||
});*/
|
});*/
|
||||||
|
|
||||||
//Чтоб список обновлялся раз в минуту в соответствии с текущем фильтром (для наглядности отправки данных)
|
//Чтоб список обновлялся раз в минуту в соответствии с текущем фильтром (для наглядности отправки данных)
|
||||||
timer.scheduleAtFixedRate(new TimerTask()
|
handler.post(runnable); // Начинаем выполнение задачи
|
||||||
{
|
|
||||||
@SuppressLint("HandlerLeak")
|
|
||||||
private Handler myHandle = new Handler() {
|
|
||||||
@Override
|
|
||||||
public void handleMessage(Message msg)
|
|
||||||
{
|
|
||||||
//onStart();
|
|
||||||
updateList();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
myHandle.sendMessage(myHandle.obtainMessage());
|
|
||||||
}
|
|
||||||
}, 0, 1000 ); //Раз в секунду
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -48,6 +48,15 @@ public class LocustListActivity extends AppCompatActivity
|
|||||||
public File file = null;
|
public File file = null;
|
||||||
//public int g_button=0;
|
//public int g_button=0;
|
||||||
|
|
||||||
|
private final Handler handler = new Handler();
|
||||||
|
private final Runnable runnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
updateList();
|
||||||
|
handler.postDelayed(this, 1000); // Раз в секунду
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public void alert(String text)
|
public void alert(String text)
|
||||||
{
|
{
|
||||||
AlertDialog.Builder adb = new AlertDialog.Builder(this,R.style.AlertDialogTheme);
|
AlertDialog.Builder adb = new AlertDialog.Builder(this,R.style.AlertDialogTheme);
|
||||||
@ -110,23 +119,7 @@ public class LocustListActivity extends AppCompatActivity
|
|||||||
|
|
||||||
|
|
||||||
//Чтоб список обновлялся раз в минуту в соответствии с текущем фильтром (для наглядности отправки данных)
|
//Чтоб список обновлялся раз в минуту в соответствии с текущем фильтром (для наглядности отправки данных)
|
||||||
timer.scheduleAtFixedRate(new TimerTask()
|
handler.post(runnable); // Начинаем выполнение задачи
|
||||||
{
|
|
||||||
@SuppressLint("HandlerLeak")
|
|
||||||
private Handler myHandle = new Handler() {
|
|
||||||
@Override
|
|
||||||
public void handleMessage(Message msg)
|
|
||||||
{
|
|
||||||
//onStart();
|
|
||||||
updateList();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
myHandle.sendMessage(myHandle.obtainMessage());
|
|
||||||
}
|
|
||||||
}, 0, 1000 ); //Раз в минуту
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -62,6 +62,47 @@ public class MainActivity extends Activity {
|
|||||||
|
|
||||||
public int g_button=0;
|
public int g_button=0;
|
||||||
|
|
||||||
|
private final Handler handler = new Handler();
|
||||||
|
private final Runnable runnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
//Если в справочнике нет ни одной записи то перезапускаем синхронизацию (иначе отображаем главное меню)
|
||||||
|
boolean exists=false;
|
||||||
|
DbOpenHelper dboh = new DbOpenHelper(MainActivity.this);
|
||||||
|
SQLiteDatabase rdb = null;
|
||||||
|
Cursor cursor=null;
|
||||||
|
try {
|
||||||
|
rdb = dboh.getReadableDatabase();
|
||||||
|
cursor = rdb.rawQuery("select c.id from borns c limit 1;", null);
|
||||||
|
if (cursor.moveToFirst())
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
exists=true;
|
||||||
|
} while (cursor.moveToNext());
|
||||||
|
}
|
||||||
|
}catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}finally{
|
||||||
|
if(cursor!=null){cursor.close();}
|
||||||
|
if(rdb!=null){ rdb.close(); }
|
||||||
|
}
|
||||||
|
dboh.close();
|
||||||
|
|
||||||
|
if(!exists) {
|
||||||
|
startService(new Intent(MainActivity.this, MainService.class).putExtra(MainService.PARAM_ACTION, "1"));
|
||||||
|
}else {
|
||||||
|
LinearLayout pBar = (LinearLayout)findViewById(R.id.pBar);
|
||||||
|
pBar.setVisibility(View.GONE);
|
||||||
|
LinearLayout form = (LinearLayout)findViewById(R.id.form);
|
||||||
|
form.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
handler.postDelayed(this, 1000*10); // Раз в 10 секунду
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -203,59 +244,15 @@ public class MainActivity extends Activity {
|
|||||||
//e.printStackTrace();
|
//e.printStackTrace();
|
||||||
Log.e("CCALM", "Error: ", e);
|
Log.e("CCALM", "Error: ", e);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
//Для синхронизации справочников
|
|
||||||
timer.scheduleAtFixedRate(new TimerTask()
|
|
||||||
{
|
|
||||||
@SuppressLint("HandlerLeak")
|
|
||||||
private Handler myHandle = new Handler() {
|
|
||||||
@Override
|
|
||||||
public void handleMessage(Message msg)
|
|
||||||
{
|
|
||||||
//Если в справочнике нет ни одной записи то перезапускаем синхронизацию (иначе отображаем главное меню)
|
|
||||||
boolean exists=false;
|
|
||||||
DbOpenHelper dboh = new DbOpenHelper(MainActivity.this);
|
|
||||||
SQLiteDatabase rdb = null;
|
|
||||||
Cursor cursor=null;
|
|
||||||
try {
|
|
||||||
rdb = dboh.getReadableDatabase();
|
|
||||||
cursor = rdb.rawQuery("select c.id from borns c limit 1;", null);
|
|
||||||
if (cursor.moveToFirst())
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
exists=true;
|
|
||||||
} while (cursor.moveToNext());
|
|
||||||
}
|
|
||||||
}catch(Exception e){
|
|
||||||
e.printStackTrace();
|
|
||||||
}finally{
|
|
||||||
if(cursor!=null){cursor.close();}
|
|
||||||
if(rdb!=null){ rdb.close(); }
|
|
||||||
}
|
|
||||||
dboh.close();
|
|
||||||
|
|
||||||
if(!exists) {
|
|
||||||
startService(new Intent(MainActivity.this, MainService.class).putExtra(MainService.PARAM_ACTION, "1"));
|
|
||||||
}else {
|
|
||||||
LinearLayout pBar = (LinearLayout)findViewById(R.id.pBar);
|
LinearLayout pBar = (LinearLayout)findViewById(R.id.pBar);
|
||||||
pBar.setVisibility(View.GONE);
|
pBar.setVisibility(View.GONE);
|
||||||
LinearLayout form = (LinearLayout)findViewById(R.id.form);
|
LinearLayout form = (LinearLayout)findViewById(R.id.form);
|
||||||
form.setVisibility(View.VISIBLE);
|
form.setVisibility(View.VISIBLE);
|
||||||
}
|
*/
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
myHandle.sendMessage(myHandle.obtainMessage());
|
|
||||||
}
|
|
||||||
}, 0, 1000 * 10 * 1 ); //Раз 10 секунд
|
|
||||||
|
|
||||||
|
|
||||||
//Подправлены переводы для грузинского и азербайджанского языка а также изменён размер фотографий на FullHD
|
|
||||||
|
|
||||||
|
//Для синхронизации справочников
|
||||||
|
handler.post(runnable); // Начинаем выполнение задачи
|
||||||
}
|
}
|
||||||
|
|
||||||
//Запрашиваю разрешения сдесь хотя GPS на другой форме использую
|
//Запрашиваю разрешения сдесь хотя GPS на другой форме использую
|
||||||
|
|||||||
@ -13,6 +13,9 @@ import android.util.Log;
|
|||||||
|
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Служба пытается отправить новые данные каждые 5 мнут на сервере, если нет данных то не отправляет.
|
* Служба пытается отправить новые данные каждые 5 мнут на сервере, если нет данных то не отправляет.
|
||||||
@ -25,13 +28,42 @@ public class MainService extends Service
|
|||||||
public final static String PARAM_ACTION = "ACTION";
|
public final static String PARAM_ACTION = "ACTION";
|
||||||
|
|
||||||
//NotificationManager m_nm; //http://startandroid.ru/ru/uroki/vse-uroki-spiskom/164-urok-99-service-uvedomlenija-notifications
|
//NotificationManager m_nm; //http://startandroid.ru/ru/uroki/vse-uroki-spiskom/164-urok-99-service-uvedomlenija-notifications
|
||||||
private Timer timer = new Timer();
|
//private Timer timer = new Timer();
|
||||||
private Timer timerP = new Timer(); //Прогрес бар уведомлений
|
//private Timer timerP = new Timer(); //Прогрес бар уведомлений
|
||||||
|
|
||||||
MySynchronizationOld _syn = null;
|
MySynchronizationOld _syn = null;
|
||||||
|
|
||||||
public PendingIntent m_pi = null; //Слушатель прогрес бара
|
public PendingIntent m_pi = null; //Слушатель прогрес бара
|
||||||
|
|
||||||
|
private final Handler handler = new Handler();
|
||||||
|
private final Runnable runnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
timerTic(false);
|
||||||
|
handler.postDelayed(this, 1000 * 60 * 5); // Повторять каждые 5 минут
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private final Handler handlerP = new Handler();
|
||||||
|
private final Runnable runnableProgress = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (MainService.this.m_pi != null) {
|
||||||
|
int cnt = _syn.getCount();
|
||||||
|
|
||||||
|
Intent intent = new Intent().putExtra(SetupActivity.PARAM_RESULT, cnt);
|
||||||
|
try {
|
||||||
|
m_pi.send(MainService.this, SetupActivity.STATUS_FINISH, intent);
|
||||||
|
} catch (PendingIntent.CanceledException e) {
|
||||||
|
Log.e("CCALM", "Error: ", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Повторяем запуск через 500 миллисекунд
|
||||||
|
handlerP.postDelayed(this, 500);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate()
|
public void onCreate()
|
||||||
{
|
{
|
||||||
@ -43,45 +75,9 @@ public class MainService extends Service
|
|||||||
|
|
||||||
_syn = new MySynchronizationOld(this);
|
_syn = new MySynchronizationOld(this);
|
||||||
|
|
||||||
timer.scheduleAtFixedRate(new TimerTask()
|
handler.post(runnable); // Начинаем выполнение задачи
|
||||||
{
|
|
||||||
@SuppressLint("HandlerLeak")
|
|
||||||
private Handler myHandle = new Handler() {
|
|
||||||
@Override
|
|
||||||
public void handleMessage(Message msg)
|
|
||||||
{
|
|
||||||
timerTic(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
handlerP.post(runnableProgress); // Начинаем выполнение задачи
|
||||||
public void run() {
|
|
||||||
myHandle.sendMessage(myHandle.obtainMessage());
|
|
||||||
}
|
|
||||||
},0,1000 * 60 * 5 ); //Раз в 5 минут (либо отдельно при сохранении записи)
|
|
||||||
|
|
||||||
//Отображаем прогресс бар синхронизации в уведомлениях каждую секунду
|
|
||||||
timerP.scheduleAtFixedRate(new TimerTask()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
if(MainService.this.m_pi != null)
|
|
||||||
{
|
|
||||||
int cnt=_syn.getCount();
|
|
||||||
|
|
||||||
Intent intent = new Intent().putExtra(SetupActivity.PARAM_RESULT, cnt);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
m_pi.send(MainService.this, SetupActivity.STATUS_FINISH, intent);
|
|
||||||
} catch (CanceledException e)
|
|
||||||
{
|
|
||||||
//e.printStackTrace();
|
|
||||||
Log.e("CCALM", "Error: ", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},0,500);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -932,7 +932,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" >
|
android:layout_height="wrap_content" >
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvSprPlatformA"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/Commercial_product_diluted"
|
android:text="@string/Commercial_product_diluted"
|
||||||
@ -953,7 +952,6 @@
|
|||||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvInsRate"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/Working_fluid_dilution_ratio"
|
android:text="@string/Working_fluid_dilution_ratio"
|
||||||
@ -974,7 +972,6 @@
|
|||||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvInsRate"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/Rate_of_working_solution_l_ha"
|
android:text="@string/Rate_of_working_solution_l_ha"
|
||||||
@ -1511,7 +1508,6 @@
|
|||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
android:layout_gravity="center_vertical"/>
|
android:layout_gravity="center_vertical"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvSprPlatform"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/Spray_platform"
|
android:text="@string/Spray_platform"
|
||||||
@ -1531,7 +1527,6 @@
|
|||||||
android:layout_height="wrap_content" >
|
android:layout_height="wrap_content" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvSprPlatformA"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/Spray_platform_a"
|
android:text="@string/Spray_platform_a"
|
||||||
@ -1551,7 +1546,6 @@
|
|||||||
android:layout_height="wrap_content" >
|
android:layout_height="wrap_content" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvSprPlatformG"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/Ground"
|
android:text="@string/Ground"
|
||||||
@ -1571,7 +1565,6 @@
|
|||||||
android:layout_height="wrap_content" >
|
android:layout_height="wrap_content" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvSprPlatformH"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/Spray_platform_h"
|
android:text="@string/Spray_platform_h"
|
||||||
|
|||||||
@ -288,7 +288,6 @@
|
|||||||
android:src="@drawable/ic_star"
|
android:src="@drawable/ic_star"
|
||||||
android:contentDescription="@null"/>
|
android:contentDescription="@null"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLatCenter"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/Lat_center"
|
android:text="@string/Lat_center"
|
||||||
@ -313,7 +312,6 @@
|
|||||||
android:src="@drawable/ic_star"
|
android:src="@drawable/ic_star"
|
||||||
android:contentDescription="@null"/>
|
android:contentDescription="@null"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLonCenter"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/Lon_center"
|
android:text="@string/Lon_center"
|
||||||
@ -517,7 +515,6 @@
|
|||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
android:layout_gravity="center_vertical"/>
|
android:layout_gravity="center_vertical"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLatCenter"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/Lat_center"
|
android:text="@string/Lat_center"
|
||||||
@ -538,7 +535,6 @@
|
|||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
android:layout_gravity="center_vertical"/>
|
android:layout_gravity="center_vertical"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLonCenter"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/Lon_center"
|
android:text="@string/Lon_center"
|
||||||
@ -1598,7 +1594,6 @@
|
|||||||
android:src="@drawable/ic_star"
|
android:src="@drawable/ic_star"
|
||||||
android:contentDescription="@null"/>
|
android:contentDescription="@null"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvSprPlatform"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@ -1629,7 +1624,6 @@
|
|||||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvSprPlatformA"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@ -1660,7 +1654,6 @@
|
|||||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvSprPlatformG"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@ -1691,7 +1684,6 @@
|
|||||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvSprPlatformH"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@ -1965,7 +1957,6 @@
|
|||||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvSprPlatformG"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@ -2041,9 +2032,7 @@
|
|||||||
android:importantForAutofill="no"
|
android:importantForAutofill="no"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:inputType="numberDecimal"
|
android:inputType="numberDecimal"/>
|
||||||
android:enabled="false"
|
|
||||||
android:focusable="false"/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -3562,7 +3551,6 @@
|
|||||||
android:showDividers="middle"
|
android:showDividers="middle"
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvImage1"
|
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -3633,7 +3621,6 @@
|
|||||||
android:showDividers="middle"
|
android:showDividers="middle"
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvImage1"
|
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -3704,7 +3691,6 @@
|
|||||||
android:showDividers="middle"
|
android:showDividers="middle"
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvImage3"
|
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -3775,7 +3761,6 @@
|
|||||||
android:showDividers="middle"
|
android:showDividers="middle"
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvImage4"
|
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -3846,7 +3831,6 @@
|
|||||||
android:showDividers="middle"
|
android:showDividers="middle"
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvImage5"
|
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@ -225,7 +225,7 @@
|
|||||||
<string name="If_yes_describe_what_happened_description">თუ კი აღწერეთ რა მოხდა</string>
|
<string name="If_yes_describe_what_happened_description">თუ კი აღწერეთ რა მოხდა</string>
|
||||||
<string name="Inform_abaut_spraying">დამუშავების შესახებ ინფორმაცია მიიღეს</string>
|
<string name="Inform_abaut_spraying">დამუშავების შესახებ ინფორმაცია მიიღეს</string>
|
||||||
<string name="Empty_containers">ცარიელი ტარა</string>
|
<string name="Empty_containers">ცარიელი ტარა</string>
|
||||||
<string name="Effect_on_non_a_organism">არამიზნობრივ ორგანიზმებზე ზემოქმედება</string>
|
<string name="Effect_on_non_target_organism">არამიზნობრივ ორგანიზმებზე ზემოქმედება</string>
|
||||||
<string name="If_Yes_type_of_organisms_and_effects_description">თუ კი, ორგანიზმის ტიპი და ეფექტი (აღწერა)</string>
|
<string name="If_Yes_type_of_organisms_and_effects_description">თუ კი, ორგანიზმის ტიპი და ეფექტი (აღწერა)</string>
|
||||||
<string name="Other_environmental_or_health_incident_reported_that_might_have_been_caused_by_the_treatment"><![CDATA[დამუშავების დროს წარმოქმნილი სხვა ინციდენტები, რომლებიც დაკავშირებულია ჯანმრთელობასა და ეკოლოგიასთან]]></string>
|
<string name="Other_environmental_or_health_incident_reported_that_might_have_been_caused_by_the_treatment"><![CDATA[დამუშავების დროს წარმოქმნილი სხვა ინციდენტები, რომლებიც დაკავშირებულია ჯანმრთელობასა და ეკოლოგიასთან]]></string>
|
||||||
<string name="If_Yes_type_of_incident_and_reported_by_whom_description">თუ კი, ინციდენტის ტიპი და ვისგან იყო მიღებული შეტყობინება (აღწერილობა)</string>
|
<string name="If_Yes_type_of_incident_and_reported_by_whom_description">თუ კი, ინციდენტის ტიპი და ვისგან იყო მიღებული შეტყობინება (აღწერილობა)</string>
|
||||||
|
|||||||
@ -355,7 +355,7 @@
|
|||||||
<string name="Type_of_assessed_biological_impact">Тип оцениваемого биологического воздействия</string>
|
<string name="Type_of_assessed_biological_impact">Тип оцениваемого биологического воздействия</string>
|
||||||
<string name="Commercial_product_diluted">Коммерческий препарат разбавлен?</string>
|
<string name="Commercial_product_diluted">Коммерческий препарат разбавлен?</string>
|
||||||
<string name="Working_fluid_dilution_ratio">Пропорция разбавления рабочей жидкости</string>
|
<string name="Working_fluid_dilution_ratio">Пропорция разбавления рабочей жидкости</string>
|
||||||
<string name="title_activity_locust_health_list">"Формы по мониторингу здоровья человека и окружающей среды (ЗЧ и ОС) "</string>
|
<string name="title_activity_locust_health_list">Формы по мониторингу здоровья человека и окружающей среды (ЗЧ и ОС)</string>
|
||||||
<string name="Show_advanced_settings">Показать дополнительные настройки</string>
|
<string name="Show_advanced_settings">Показать дополнительные настройки</string>
|
||||||
<string name="Delete_all_data">Удалить все данные</string>
|
<string name="Delete_all_data">Удалить все данные</string>
|
||||||
<string name="Help">Помощь</string>
|
<string name="Help">Помощь</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user