From 671d839e9fd5669ab3feda8086d98743ed63d446 Mon Sep 17 00:00:00 2001 From: Igor I Date: Wed, 7 Aug 2024 19:08:12 +0500 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=B5=D1=80=D0=BD=D1=83=D0=BB=20=D0=B2?= =?UTF-8?q?=D1=8B=D0=B1=D0=BE=D1=80=D0=BA=D1=83=20=D1=81=20=D1=80=D1=83?= =?UTF-8?q?=D1=87=D0=BD=D1=8B=D0=BC=20=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=D0=BC=20=D1=82=D0=B8=D0=BF=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/kz/istt/locust/MySynchronizationOld.java | 13 ++++++------- app/src/main/java/tools/TCTableTools2.java | 1 + app/src/main/res/xml/network_security_config.xml | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/kz/istt/locust/MySynchronizationOld.java b/app/src/main/java/kz/istt/locust/MySynchronizationOld.java index 12ef7ba..f61b744 100644 --- a/app/src/main/java/kz/istt/locust/MySynchronizationOld.java +++ b/app/src/main/java/kz/istt/locust/MySynchronizationOld.java @@ -311,13 +311,12 @@ public class MySynchronizationOld rid_sendFrmLocust = myThread.addRequest(MySynchronizationOld.URL+"/get/", xml, null,null); //Отправляю данные координат отдельно (без подтверждения доставки, потом нужно добавить поле send boolean и отправлять отдельно от frmlocustdel) - Cursor cursor3 = dboh.getReadableDatabase().rawQuery("select uid,del,seq,frmlocustdel_uid,pos,lon,lat from frmlocustdel_locations where frmlocustdel_uid=? order by pos", new String[] { String.valueOf(uid) }); +/* Cursor cursor3 = dboh.getReadableDatabase().rawQuery("select uid,del,seq,frmlocustdel_uid,pos,lon,lat from frmlocustdel_locations where frmlocustdel_uid=? order by pos", new String[] { String.valueOf(uid) }); ByteArrayOutputStream outStream = new ByteArrayOutputStream(); TCTableTools2.getTCTableFromCursor("frmlocustdel_locations", 0, cursor3, outStream); - myThread.addRequest(MySynchronizationOld.URL+"/asdc/tctable/", null, null, outStream.toByteArray()); + myThread.addRequest(MySynchronizationOld.URL+"/asdc/tctable/", null, null, outStream.toByteArray());*/ - -/* ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); TCTable tbl = new TCTable("frmlocustdel_locations", 0); tbl.addField(new TCField("uid",TCField.BD_UTF8_1)); tbl.addField(new TCField("del",TCField.BD_UINT1)); @@ -336,15 +335,15 @@ public class MySynchronizationOld tbl.fields.get(2).setValue(cursor3.getString(2)); tbl.fields.get(3).setValue(cursor3.getString(3)); tbl.fields.get(4).setValue(cursor3.getString(4)); - tbl.fields.get(5).setValue(cursor3.getString(5)); - tbl.fields.get(6).setValue(cursor3.getString(6)); + tbl.fields.get(5).setDoubleVal(cursor3.getDouble(5)); + tbl.fields.get(6).setDoubleVal(cursor3.getDouble(6)); tbl.getCol(outStream); }while (cursor3.moveToNext()); } cursor3.close(); //Отправляю пакет данных на сервер для вставки либо обновления myThread.addRequest(MySynchronizationOld.URL+"/asdc/tctable/", null, null, outStream.toByteArray()); -*/ + }while (cursor.moveToNext()); } diff --git a/app/src/main/java/tools/TCTableTools2.java b/app/src/main/java/tools/TCTableTools2.java index 7c94131..d25875e 100644 --- a/app/src/main/java/tools/TCTableTools2.java +++ b/app/src/main/java/tools/TCTableTools2.java @@ -27,6 +27,7 @@ public class TCTableTools2 { return result; } + //TODO не получится! нет такого функционала чтобы выбрать из Cursor типы полей если поле будет null то вернёт тип поля null!!!! //Записать таблицу в OutputStream из курсора андроида public static boolean getTCTableFromCursor(String name, int id, Cursor cursor, OutputStream os) { TCTable tbl = new TCTable(name, id); diff --git a/app/src/main/res/xml/network_security_config.xml b/app/src/main/res/xml/network_security_config.xml index dd6d15f..80308e4 100644 --- a/app/src/main/res/xml/network_security_config.xml +++ b/app/src/main/res/xml/network_security_config.xml @@ -5,6 +5,7 @@ ccalm.org test.ccalm.org 192.168.200.100 + 192.168.0.170 10.0.2.2 \ No newline at end of file