Version: 4:11:02

Se arrglo el resumen dia, ahora puedes entrar sin necesidad de hacer algun pedido sin que truene, se muestra la cantidad de clientes visitados sin importar si tienen o no tienen venta y tambien se le agrego la cantidad de clientes que si tienen venta.
This commit is contained in:
IsR0d
2024-11-04 12:36:27 -06:00
parent 65319638b4
commit f9f3ff7d6e
545 changed files with 22807 additions and 103664 deletions

View File

@@ -14,7 +14,7 @@ public class tracker extends android.app.Service{
android.content.Intent in = new android.content.Intent(context, tracker.class);
if (intent != null)
in.putExtra("b4a_internal_intent", intent);
ServiceHelper.StarterHelper.startServiceFromReceiver (context, in, false, anywheresoftware.b4a.ShellBA.class);
ServiceHelper.StarterHelper.startServiceFromReceiver (context, in, false, BA.class);
}
}
@@ -29,7 +29,7 @@ public class tracker extends android.app.Service{
super.onCreate();
mostCurrent = this;
if (processBA == null) {
processBA = new anywheresoftware.b4a.ShellBA(this, null, null, "keymon.lat.medicomed", "keymon.lat.medicomed.tracker");
processBA = new BA(this, null, null, "keymon.lat.medicomed", "keymon.lat.medicomed.tracker");
if (BA.isShellModeRuntimeCheck(processBA)) {
processBA.raiseEvent2(null, true, "SHELL", false);
}
@@ -127,8 +127,7 @@ public class tracker extends android.app.Service{
@Override
public android.os.IBinder onBind(android.content.Intent intent) {
return null;
}
public anywheresoftware.b4a.keywords.Common __c = null;
}public anywheresoftware.b4a.keywords.Common __c = null;
public static int _nid = 0;
public static boolean _tracking = false;
public static anywheresoftware.b4a.phone.Phone.PhoneWakeState _lock = null;
@@ -148,339 +147,328 @@ public keymon.lat.medicomed.b4xcollections _b4xcollections = null;
public keymon.lat.medicomed.httputils2service _httputils2service = null;
public keymon.lat.medicomed.xuiviewsutils _xuiviewsutils = null;
public static uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest _createlocationrequest() throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "createlocationrequest", false))
{return ((uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest) Debug.delegate(processBA, "createlocationrequest", null));}
uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest _lr = null;
RDebugUtils.currentLine=29556736;
//BA.debugLineNum = 29556736;BA.debugLine="Private Sub CreateLocationRequest As LocationReque";
RDebugUtils.currentLine=29556738;
//BA.debugLineNum = 29556738;BA.debugLine="Dim lr As LocationRequest";
//BA.debugLineNum = 111;BA.debugLine="Private Sub CreateLocationRequest As LocationReque";
//BA.debugLineNum = 113;BA.debugLine="Dim lr As LocationRequest";
_lr = new uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest();
RDebugUtils.currentLine=29556739;
//BA.debugLineNum = 29556739;BA.debugLine="lr.Initialize";
//BA.debugLineNum = 114;BA.debugLine="lr.Initialize";
_lr.Initialize();
RDebugUtils.currentLine=29556740;
//BA.debugLineNum = 29556740;BA.debugLine="lr.SetInterval(10000) 'Intervalo deseado para act";
//BA.debugLineNum = 115;BA.debugLine="lr.SetInterval(10000) 'Intervalo deseado para act";
_lr.SetInterval((long) (10000));
RDebugUtils.currentLine=29556741;
//BA.debugLineNum = 29556741;BA.debugLine="lr.SetFastestInterval(lr.GetInterval / 2) 'Interv";
//BA.debugLineNum = 116;BA.debugLine="lr.SetFastestInterval(lr.GetInterval / 2) 'Interv";
_lr.SetFastestInterval((long) (_lr.GetInterval()/(double)2));
RDebugUtils.currentLine=29556742;
//BA.debugLineNum = 29556742;BA.debugLine="lr.SetSmallestDisplacement(50) 'Solo registra cam";
//BA.debugLineNum = 117;BA.debugLine="lr.SetSmallestDisplacement(50) 'Solo registra cam";
_lr.SetSmallestDisplacement((float) (50));
RDebugUtils.currentLine=29556743;
//BA.debugLineNum = 29556743;BA.debugLine="lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY";
//BA.debugLineNum = 118;BA.debugLine="lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY";
_lr.SetPriority(_lr.Priority.PRIORITY_HIGH_ACCURACY);
RDebugUtils.currentLine=29556744;
//BA.debugLineNum = 29556744;BA.debugLine="actualLR=lr";
//BA.debugLineNum = 119;BA.debugLine="actualLR=lr";
_actuallr = _lr;
RDebugUtils.currentLine=29556745;
//BA.debugLineNum = 29556745;BA.debugLine="Return lr";
//BA.debugLineNum = 120;BA.debugLine="Return lr";
if (true) return _lr;
RDebugUtils.currentLine=29556746;
//BA.debugLineNum = 29556746;BA.debugLine="End Sub";
//BA.debugLineNum = 121;BA.debugLine="End Sub";
return null;
}
public static uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest _createlocationrequestsmalld() throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "createlocationrequestsmalld", false))
{return ((uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest) Debug.delegate(processBA, "createlocationrequestsmalld", null));}
uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest _lr = null;
RDebugUtils.currentLine=29622272;
//BA.debugLineNum = 29622272;BA.debugLine="Private Sub CreateLocationRequestSmallD As Locatio";
RDebugUtils.currentLine=29622274;
//BA.debugLineNum = 29622274;BA.debugLine="Dim lr As LocationRequest";
//BA.debugLineNum = 123;BA.debugLine="Private Sub CreateLocationRequestSmallD As Locatio";
//BA.debugLineNum = 125;BA.debugLine="Dim lr As LocationRequest";
_lr = new uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest();
RDebugUtils.currentLine=29622275;
//BA.debugLineNum = 29622275;BA.debugLine="lr.Initialize";
//BA.debugLineNum = 126;BA.debugLine="lr.Initialize";
_lr.Initialize();
RDebugUtils.currentLine=29622276;
//BA.debugLineNum = 29622276;BA.debugLine="lr.SetInterval(2000) 'Intervalo deseado para actu";
//BA.debugLineNum = 127;BA.debugLine="lr.SetInterval(2000) 'Intervalo deseado para actu";
_lr.SetInterval((long) (2000));
RDebugUtils.currentLine=29622277;
//BA.debugLineNum = 29622277;BA.debugLine="lr.SetFastestInterval(lr.GetInterval / 2) 'Interv";
//BA.debugLineNum = 128;BA.debugLine="lr.SetFastestInterval(lr.GetInterval / 2) 'Interv";
_lr.SetFastestInterval((long) (_lr.GetInterval()/(double)2));
RDebugUtils.currentLine=29622278;
//BA.debugLineNum = 29622278;BA.debugLine="lr.setNumUpdates(2) 'Solicitamos solo 2 actualiza";
//BA.debugLineNum = 129;BA.debugLine="lr.setNumUpdates(2) 'Solicitamos solo 2 actualiza";
_lr.SetNumUpdates((int) (2));
RDebugUtils.currentLine=29622279;
//BA.debugLineNum = 29622279;BA.debugLine="lr.SetSmallestDisplacement(0) 'Solo registra camb";
//BA.debugLineNum = 130;BA.debugLine="lr.SetSmallestDisplacement(0) 'Solo registra camb";
_lr.SetSmallestDisplacement((float) (0));
RDebugUtils.currentLine=29622280;
//BA.debugLineNum = 29622280;BA.debugLine="lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY";
//BA.debugLineNum = 131;BA.debugLine="lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY";
_lr.SetPriority(_lr.Priority.PRIORITY_HIGH_ACCURACY);
RDebugUtils.currentLine=29622281;
//BA.debugLineNum = 29622281;BA.debugLine="actualLR=lr";
//BA.debugLineNum = 132;BA.debugLine="actualLR=lr";
_actuallr = _lr;
RDebugUtils.currentLine=29622282;
//BA.debugLineNum = 29622282;BA.debugLine="Return lr";
//BA.debugLineNum = 133;BA.debugLine="Return lr";
if (true) return _lr;
RDebugUtils.currentLine=29622283;
//BA.debugLineNum = 29622283;BA.debugLine="End Sub";
//BA.debugLineNum = 134;BA.debugLine="End Sub";
return null;
}
public static anywheresoftware.b4a.objects.NotificationWrapper _createnotification(String _body) throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "createnotification", false))
{return ((anywheresoftware.b4a.objects.NotificationWrapper) Debug.delegate(processBA, "createnotification", new Object[] {_body}));}
anywheresoftware.b4a.objects.NotificationWrapper _notification = null;
RDebugUtils.currentLine=29884416;
//BA.debugLineNum = 29884416;BA.debugLine="Sub CreateNotification (Body As String) As Notific";
RDebugUtils.currentLine=29884417;
//BA.debugLineNum = 29884417;BA.debugLine="Dim notification As Notification";
//BA.debugLineNum = 194;BA.debugLine="Sub CreateNotification (Body As String) As Notific";
//BA.debugLineNum = 195;BA.debugLine="Dim notification As Notification";
_notification = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=29884418;
//BA.debugLineNum = 29884418;BA.debugLine="notification.Initialize2(notification.IMPORTANCE_";
//BA.debugLineNum = 196;BA.debugLine="notification.Initialize2(notification.IMPORTANCE_";
_notification.Initialize2(_notification.IMPORTANCE_LOW);
RDebugUtils.currentLine=29884419;
//BA.debugLineNum = 29884419;BA.debugLine="notification.Icon = \"icon\"";
//BA.debugLineNum = 197;BA.debugLine="notification.Icon = \"icon\"";
_notification.setIcon("icon");
RDebugUtils.currentLine=29884420;
//BA.debugLineNum = 29884420;BA.debugLine="notification.SetInfo(\"Medicomed\", Body, Main)";
//BA.debugLineNum = 198;BA.debugLine="notification.SetInfo(\"Medicomed\", Body, Main)";
_notification.SetInfoNew(processBA,BA.ObjectToCharSequence("Medicomed"),BA.ObjectToCharSequence(_body),(Object)(mostCurrent._main.getObject()));
RDebugUtils.currentLine=29884421;
//BA.debugLineNum = 29884421;BA.debugLine="Return notification";
//BA.debugLineNum = 199;BA.debugLine="Return notification";
if (true) return _notification;
RDebugUtils.currentLine=29884422;
//BA.debugLineNum = 29884422;BA.debugLine="End Sub";
//BA.debugLineNum = 200;BA.debugLine="End Sub";
return null;
}
public static String _dameultimaubicacionconocida() throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "dameultimaubicacionconocida", false))
{return ((String) Debug.delegate(processBA, "dameultimaubicacionconocida", null));}
String _coords = "";
RDebugUtils.currentLine=29687808;
//BA.debugLineNum = 29687808;BA.debugLine="Sub dameUltimaUbicacionConocida";
RDebugUtils.currentLine=29687809;
//BA.debugLineNum = 29687809;BA.debugLine="If FLP.GetLastKnownLocation.IsInitialized Then 'M";
//BA.debugLineNum = 136;BA.debugLine="Sub dameUltimaUbicacionConocida";
//BA.debugLineNum = 137;BA.debugLine="If FLP.GetLastKnownLocation.IsInitialized Then 'M";
if (_flp.GetLastKnownLocation().IsInitialized()) {
RDebugUtils.currentLine=29687811;
//BA.debugLineNum = 29687811;BA.debugLine="If Starter.Logger Then LogColor($\"Mandamos UUC \"";
//BA.debugLineNum = 139;BA.debugLine="If Starter.Logger Then LogColor($\"Mandamos UUC \"";
if (mostCurrent._starter._logger /*boolean*/ ) {
anywheresoftware.b4a.keywords.Common.LogImpl("329687811",("Mandamos UUC \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._subs._fechakmt /*String*/ (processBA,BA.NumberToString(_flp.GetLastKnownLocation().getTime()))))+"|Acc:"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.2",(Object)(_flp.GetLastKnownLocation().getAccuracy()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.8",(Object)(_flp.GetLastKnownLocation().getLatitude()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.8",(Object)(_flp.GetLastKnownLocation().getLongitude()))+"|Spd:"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.2",(Object)(_flp.GetLastKnownLocation().getSpeed()))+"|"),anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (255),(int) (112),(int) (35)));};
RDebugUtils.currentLine=29687812;
//BA.debugLineNum = 29687812;BA.debugLine="Dim coords As String = FLP.GetLastKnownLocation.";
anywheresoftware.b4a.keywords.Common.LogImpl("365994755",("Mandamos UUC \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._subs._fechakmt /*String*/ (processBA,BA.NumberToString(_flp.GetLastKnownLocation().getTime()))))+"|Acc:"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.2",(Object)(_flp.GetLastKnownLocation().getAccuracy()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.8",(Object)(_flp.GetLastKnownLocation().getLatitude()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.8",(Object)(_flp.GetLastKnownLocation().getLongitude()))+"|Spd:"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.2",(Object)(_flp.GetLastKnownLocation().getSpeed()))+"|"),anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (255),(int) (112),(int) (35)));};
//BA.debugLineNum = 140;BA.debugLine="Dim coords As String = FLP.GetLastKnownLocation.";
_coords = BA.NumberToString(_flp.GetLastKnownLocation().getLatitude())+","+BA.NumberToString(_flp.GetLastKnownLocation().getLongitude())+","+_formatofecha(BA.NumberToString(_flp.GetLastKnownLocation().getTime()));
};
RDebugUtils.currentLine=29687816;
//BA.debugLineNum = 29687816;BA.debugLine="End Sub";
return "";
}
public static String _formatofecha(String _fecha) throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "formatofecha", false))
{return ((String) Debug.delegate(processBA, "formatofecha", new Object[] {_fecha}));}
String _origformat = "";
String _lastupdate = "";
RDebugUtils.currentLine=30015488;
//BA.debugLineNum = 30015488;BA.debugLine="Sub formatoFecha(fecha As String) As String 'Convi";
RDebugUtils.currentLine=30015490;
//BA.debugLineNum = 30015490;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat '";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=30015491;
//BA.debugLineNum = 30015491;BA.debugLine="DateTime.DateFormat=\"yyMMddHHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMddHHmmss");
RDebugUtils.currentLine=30015492;
//BA.debugLineNum = 30015492;BA.debugLine="Dim lastUpdate As String=DateTime.Date(fecha)";
_lastupdate = anywheresoftware.b4a.keywords.Common.DateTime.Date((long)(Double.parseDouble(_fecha)));
RDebugUtils.currentLine=30015493;
//BA.debugLineNum = 30015493;BA.debugLine="DateTime.DateFormat=OrigFormat 'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=30015495;
//BA.debugLineNum = 30015495;BA.debugLine="Return lastUpdate";
if (true) return _lastupdate;
RDebugUtils.currentLine=30015496;
//BA.debugLineNum = 30015496;BA.debugLine="End Sub";
//BA.debugLineNum = 144;BA.debugLine="End Sub";
return "";
}
public static String _flp_connectionfailed(int _connectionresult1) throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "flp_connectionfailed", false))
{return ((String) Debug.delegate(processBA, "flp_connectionfailed", new Object[] {_connectionresult1}));}
RDebugUtils.currentLine=29229056;
//BA.debugLineNum = 29229056;BA.debugLine="Sub flp_ConnectionFailed(ConnectionResult1 As Int)";
RDebugUtils.currentLine=29229057;
//BA.debugLineNum = 29229057;BA.debugLine="Log(\"Failed to connect to location provider\")";
anywheresoftware.b4a.keywords.Common.LogImpl("329229057","Failed to connect to location provider",0);
RDebugUtils.currentLine=29229058;
//BA.debugLineNum = 29229058;BA.debugLine="End Sub";
//BA.debugLineNum = 55;BA.debugLine="Sub flp_ConnectionFailed(ConnectionResult1 As Int)";
//BA.debugLineNum = 56;BA.debugLine="Log(\"Failed to connect to location provider\")";
anywheresoftware.b4a.keywords.Common.LogImpl("365536001","Failed to connect to location provider",0);
//BA.debugLineNum = 57;BA.debugLine="End Sub";
return "";
}
public static String _flp_connectionsuccess() throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "flp_connectionsuccess", false))
{return ((String) Debug.delegate(processBA, "flp_connectionsuccess", null));}
RDebugUtils.currentLine=29163520;
//BA.debugLineNum = 29163520;BA.debugLine="Sub flp_ConnectionSuccess";
RDebugUtils.currentLine=29163523;
//BA.debugLineNum = 29163523;BA.debugLine="End Sub";
//BA.debugLineNum = 50;BA.debugLine="Sub flp_ConnectionSuccess";
//BA.debugLineNum = 53;BA.debugLine="End Sub";
return "";
}
public static String _flp_locationchanged(anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "flp_locationchanged", false))
{return ((String) Debug.delegate(processBA, "flp_locationchanged", new Object[] {_location1}));}
String _sdate = "";
String _stime = "";
String _coords = "";
RDebugUtils.currentLine=29818880;
//BA.debugLineNum = 29818880;BA.debugLine="Sub flp_LocationChanged (Location1 As Location)";
RDebugUtils.currentLine=29818883;
//BA.debugLineNum = 29818883;BA.debugLine="B4XPages.MainPage.lat_gps = Location1.Latitude";
//BA.debugLineNum = 154;BA.debugLine="Sub flp_LocationChanged (Location1 As Location)";
//BA.debugLineNum = 157;BA.debugLine="B4XPages.MainPage.lat_gps = Location1.Latitude";
mostCurrent._b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (processBA)._lat_gps /*String*/ = BA.NumberToString(_location1.getLatitude());
RDebugUtils.currentLine=29818884;
//BA.debugLineNum = 29818884;BA.debugLine="B4XPages.MainPage.lon_gps = Location1.Longitude";
//BA.debugLineNum = 158;BA.debugLine="B4XPages.MainPage.lon_gps = Location1.Longitude";
mostCurrent._b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (processBA)._lon_gps /*String*/ = BA.NumberToString(_location1.getLongitude());
RDebugUtils.currentLine=29818885;
//BA.debugLineNum = 29818885;BA.debugLine="UUGCoords = Location1";
//BA.debugLineNum = 159;BA.debugLine="UUGCoords = Location1";
_uugcoords = _location1;
RDebugUtils.currentLine=29818893;
//BA.debugLineNum = 29818893;BA.debugLine="Dim sDate,sTime As String";
//BA.debugLineNum = 167;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
RDebugUtils.currentLine=29818894;
//BA.debugLineNum = 29818894;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
//BA.debugLineNum = 168;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=29818895;
//BA.debugLineNum = 29818895;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
//BA.debugLineNum = 169;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = anywheresoftware.b4a.keywords.Common.DateTime.Date(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=29818896;
//BA.debugLineNum = 29818896;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
//BA.debugLineNum = 170;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = anywheresoftware.b4a.keywords.Common.DateTime.Time(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=29818897;
//BA.debugLineNum = 29818897;BA.debugLine="If Not(B4XPages.MainPage.skmt.IsInitialized) Then";
//BA.debugLineNum = 171;BA.debugLine="If Not(B4XPages.MainPage.skmt.IsInitialized) Then";
if (anywheresoftware.b4a.keywords.Common.Not(mostCurrent._b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (processBA)._skmt /*anywheresoftware.b4a.sql.SQL*/ .IsInitialized())) {
mostCurrent._b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (processBA)._skmt /*anywheresoftware.b4a.sql.SQL*/ .Initialize(mostCurrent._starter._ruta /*String*/ ,"kmt.db",anywheresoftware.b4a.keywords.Common.True);};
RDebugUtils.currentLine=29818898;
//BA.debugLineNum = 29818898;BA.debugLine="Try";
try {RDebugUtils.currentLine=29818899;
//BA.debugLineNum = 29818899;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
//BA.debugLineNum = 172;BA.debugLine="Try";
try { //BA.debugLineNum = 173;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
mostCurrent._b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (processBA)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO HIST_GPS (HGDATE, HGLAT, HGLON) VALUES(?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_sdate+_stime),(Object)(mostCurrent._b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (processBA)._lat_gps /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (processBA)._lon_gps /*String*/ )}));
RDebugUtils.currentLine=29818900;
//BA.debugLineNum = 29818900;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"DELETE FROM";
//BA.debugLineNum = 174;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"DELETE FROM";
mostCurrent._b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (processBA)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("DELETE FROM HIST_GPS");
}
catch (Exception e13) {
processBA.setLastException(e13);RDebugUtils.currentLine=29818902;
//BA.debugLineNum = 29818902;BA.debugLine="LogColor(LastException, Colors.Red)";
anywheresoftware.b4a.keywords.Common.LogImpl("329818902",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
processBA.setLastException(e13); //BA.debugLineNum = 176;BA.debugLine="LogColor(LastException, Colors.Red)";
anywheresoftware.b4a.keywords.Common.LogImpl("366125846",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
};
RDebugUtils.currentLine=29818905;
//BA.debugLineNum = 29818905;BA.debugLine="Dim coords As String = Location1.Latitude&\",\"&Loc";
//BA.debugLineNum = 179;BA.debugLine="Dim coords As String = Location1.Latitude&\",\"&Loc";
_coords = BA.NumberToString(_location1.getLatitude())+","+BA.NumberToString(_location1.getLongitude())+","+_formatofecha(BA.NumberToString(_location1.getTime()));
RDebugUtils.currentLine=29818910;
//BA.debugLineNum = 29818910;BA.debugLine="If Location1.Accuracy < 100 Then";
//BA.debugLineNum = 184;BA.debugLine="If Location1.Accuracy < 100 Then";
if (_location1.getAccuracy()<100) {
};
RDebugUtils.currentLine=29818914;
//BA.debugLineNum = 29818914;BA.debugLine="CallSub2(Starter, \"GPS_LocationChanged\", Location";
anywheresoftware.b4a.keywords.Common.CallSubDebug2(processBA,(Object)(mostCurrent._starter.getObject()),"GPS_LocationChanged",(Object)(_location1));
RDebugUtils.currentLine=29818918;
//BA.debugLineNum = 29818918;BA.debugLine="End Sub";
//BA.debugLineNum = 188;BA.debugLine="CallSub2(Starter, \"GPS_LocationChanged\", Location";
anywheresoftware.b4a.keywords.Common.CallSubNew2(processBA,(Object)(mostCurrent._starter.getObject()),"GPS_LocationChanged",(Object)(_location1));
//BA.debugLineNum = 192;BA.debugLine="End Sub";
return "";
}
public static String _formatofecha(String _fecha) throws Exception{
String _origformat = "";
String _lastupdate = "";
//BA.debugLineNum = 210;BA.debugLine="Sub formatoFecha(fecha As String) As String 'Convi";
//BA.debugLineNum = 212;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat '";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
//BA.debugLineNum = 213;BA.debugLine="DateTime.DateFormat=\"yyMMddHHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMddHHmmss");
//BA.debugLineNum = 214;BA.debugLine="Dim lastUpdate As String=DateTime.Date(fecha)";
_lastupdate = anywheresoftware.b4a.keywords.Common.DateTime.Date((long)(Double.parseDouble(_fecha)));
//BA.debugLineNum = 215;BA.debugLine="DateTime.DateFormat=OrigFormat 'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
//BA.debugLineNum = 217;BA.debugLine="Return lastUpdate";
if (true) return _lastupdate;
//BA.debugLineNum = 218;BA.debugLine="End Sub";
return "";
}
public static String _process_globals() throws Exception{
//BA.debugLineNum = 29;BA.debugLine="Sub Process_Globals";
//BA.debugLineNum = 30;BA.debugLine="Private nid As Int = 51042";
_nid = (int) (51042);
//BA.debugLineNum = 31;BA.debugLine="Private Tracking As Boolean";
_tracking = false;
//BA.debugLineNum = 32;BA.debugLine="Private lock As PhoneWakeState";
_lock = new anywheresoftware.b4a.phone.Phone.PhoneWakeState();
//BA.debugLineNum = 34;BA.debugLine="Public FLP As FusedLocationProvider";
_flp = new uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper();
//BA.debugLineNum = 35;BA.debugLine="Dim actualLR As LocationRequest";
_actuallr = new uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest();
//BA.debugLineNum = 36;BA.debugLine="Private flpStarted As Boolean";
_flpstarted = false;
//BA.debugLineNum = 38;BA.debugLine="Dim UUGCoords As Location 'Ultima Ubicacion Guard";
_uugcoords = new anywheresoftware.b4a.gps.LocationWrapper();
//BA.debugLineNum = 39;BA.debugLine="End Sub";
return "";
}
public static String _revisaflp() throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "revisaflp", false))
{return ((String) Debug.delegate(processBA, "revisaflp", null));}
boolean _todobienflp = false;
RDebugUtils.currentLine=30081024;
//BA.debugLineNum = 30081024;BA.debugLine="Sub revisaFLP 'ignore";
RDebugUtils.currentLine=30081025;
//BA.debugLineNum = 30081025;BA.debugLine="LogColor(\"**** **** Revisamos FLP **** ****\", Col";
anywheresoftware.b4a.keywords.Common.LogImpl("330081025","**** **** Revisamos FLP **** ****",anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (78),(int) (0),(int) (227)));
RDebugUtils.currentLine=30081026;
//BA.debugLineNum = 30081026;BA.debugLine="Private todoBienFLP As Boolean = True";
//BA.debugLineNum = 221;BA.debugLine="Sub revisaFLP 'ignore";
//BA.debugLineNum = 222;BA.debugLine="LogColor(\"**** **** Revisamos FLP **** ****\", Col";
anywheresoftware.b4a.keywords.Common.LogImpl("366387969","**** **** Revisamos FLP **** ****",anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (78),(int) (0),(int) (227)));
//BA.debugLineNum = 223;BA.debugLine="Private todoBienFLP As Boolean = True";
_todobienflp = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=30081027;
//BA.debugLineNum = 30081027;BA.debugLine="Try";
try {RDebugUtils.currentLine=30081028;
//BA.debugLineNum = 30081028;BA.debugLine="If Not(FLP.IsInitialized) Then";
//BA.debugLineNum = 224;BA.debugLine="Try";
try { //BA.debugLineNum = 225;BA.debugLine="If Not(FLP.IsInitialized) Then";
if (anywheresoftware.b4a.keywords.Common.Not(_flp.IsInitialized())) {
RDebugUtils.currentLine=30081029;
//BA.debugLineNum = 30081029;BA.debugLine="Subs.log2DB(\"revisaFLP: No esta inicializado ..";
//BA.debugLineNum = 226;BA.debugLine="Subs.log2DB(\"revisaFLP: No esta inicializado ..";
mostCurrent._subs._log2db /*String*/ (processBA,"revisaFLP: No esta inicializado ... 'Reinicializando FLP'");
RDebugUtils.currentLine=30081030;
//BA.debugLineNum = 30081030;BA.debugLine="FLP.Initialize(\"flp\")";
//BA.debugLineNum = 227;BA.debugLine="FLP.Initialize(\"flp\")";
_flp.Initialize(processBA,"flp");
RDebugUtils.currentLine=30081031;
//BA.debugLineNum = 30081031;BA.debugLine="todoBienFLP = False";
//BA.debugLineNum = 228;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
};
}
catch (Exception e10) {
processBA.setLastException(e10);RDebugUtils.currentLine=30081034;
//BA.debugLineNum = 30081034;BA.debugLine="LogColor(\"If Not(Tracker.FLP.IsInitialized) -->";
anywheresoftware.b4a.keywords.Common.LogImpl("330081034","If Not(Tracker.FLP.IsInitialized) --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
processBA.setLastException(e10); //BA.debugLineNum = 231;BA.debugLine="LogColor(\"If Not(Tracker.FLP.IsInitialized) -->";
anywheresoftware.b4a.keywords.Common.LogImpl("366387978","If Not(Tracker.FLP.IsInitialized) --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
};
RDebugUtils.currentLine=30081036;
//BA.debugLineNum = 30081036;BA.debugLine="Try";
try {RDebugUtils.currentLine=30081037;
//BA.debugLineNum = 30081037;BA.debugLine="If FLP.IsInitialized Then";
//BA.debugLineNum = 233;BA.debugLine="Try";
try { //BA.debugLineNum = 234;BA.debugLine="If FLP.IsInitialized Then";
if (_flp.IsInitialized()) {
RDebugUtils.currentLine=30081038;
//BA.debugLineNum = 30081038;BA.debugLine="Try";
try {RDebugUtils.currentLine=30081039;
//BA.debugLineNum = 30081039;BA.debugLine="If Not(FLP.IsConnected) Then";
//BA.debugLineNum = 235;BA.debugLine="Try";
try { //BA.debugLineNum = 236;BA.debugLine="If Not(FLP.IsConnected) Then";
if (anywheresoftware.b4a.keywords.Common.Not(_flp.IsConnected())) {
RDebugUtils.currentLine=30081040;
//BA.debugLineNum = 30081040;BA.debugLine="Subs.log2DB(\"revisaFLP: No esta conectado ...";
//BA.debugLineNum = 237;BA.debugLine="Subs.log2DB(\"revisaFLP: No esta conectado ...";
mostCurrent._subs._log2db /*String*/ (processBA,"revisaFLP: No esta conectado ... 'Reconectando FLP'");
RDebugUtils.currentLine=30081042;
//BA.debugLineNum = 30081042;BA.debugLine="StartFLP";
//BA.debugLineNum = 239;BA.debugLine="StartFLP";
_startflp();
RDebugUtils.currentLine=30081043;
//BA.debugLineNum = 30081043;BA.debugLine="todoBienFLP = False";
//BA.debugLineNum = 240;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
};
}
catch (Exception e21) {
processBA.setLastException(e21);RDebugUtils.currentLine=30081046;
//BA.debugLineNum = 30081046;BA.debugLine="LogColor(\"If Not(Tracker.FLP.IsConnected) -->";
anywheresoftware.b4a.keywords.Common.LogImpl("330081046","If Not(Tracker.FLP.IsConnected) --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
processBA.setLastException(e21); //BA.debugLineNum = 243;BA.debugLine="LogColor(\"If Not(Tracker.FLP.IsConnected) -->";
anywheresoftware.b4a.keywords.Common.LogImpl("366387990","If Not(Tracker.FLP.IsConnected) --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
};
RDebugUtils.currentLine=30081048;
//BA.debugLineNum = 30081048;BA.debugLine="Try";
try {RDebugUtils.currentLine=30081049;
//BA.debugLineNum = 30081049;BA.debugLine="If FLP.IsConnected And _ FLP.GetLastKnown";
//BA.debugLineNum = 245;BA.debugLine="Try";
try { //BA.debugLineNum = 246;BA.debugLine="If FLP.IsConnected And _ FLP.GetLastKnown";
if (_flp.IsConnected() && _flp.GetLastKnownLocation().IsInitialized() && _flp.GetLastKnownLocation().DistanceTo((android.location.Location)(_uugcoords.getObject()))>500) {
RDebugUtils.currentLine=30081052;
//BA.debugLineNum = 30081052;BA.debugLine="Subs.log2DB(\"revisaFLP: 'No se esta actualiza";
//BA.debugLineNum = 249;BA.debugLine="Subs.log2DB(\"revisaFLP: 'No se esta actualiza";
mostCurrent._subs._log2db /*String*/ (processBA,"revisaFLP: 'No se esta actualizando, lo reiniciamos ...'");
RDebugUtils.currentLine=30081053;
//BA.debugLineNum = 30081053;BA.debugLine="StartService(Me)";
//BA.debugLineNum = 250;BA.debugLine="StartService(Me)";
anywheresoftware.b4a.keywords.Common.StartService(processBA,tracker.getObject());
RDebugUtils.currentLine=30081054;
//BA.debugLineNum = 30081054;BA.debugLine="todoBienFLP = False";
//BA.debugLineNum = 251;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
};
}
catch (Exception e30) {
processBA.setLastException(e30);RDebugUtils.currentLine=30081057;
//BA.debugLineNum = 30081057;BA.debugLine="LogColor(\"If FLP.IsConnectctd and FLP.getLKL.I";
anywheresoftware.b4a.keywords.Common.LogImpl("330081057","If FLP.IsConnectctd and FLP.getLKL.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
processBA.setLastException(e30); //BA.debugLineNum = 254;BA.debugLine="LogColor(\"If FLP.IsConnectctd and FLP.getLKL.I";
anywheresoftware.b4a.keywords.Common.LogImpl("366388001","If FLP.IsConnectctd and FLP.getLKL.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
};
};
RDebugUtils.currentLine=30081060;
//BA.debugLineNum = 30081060;BA.debugLine="If todoBienFLP Then LogColor(\" +++ +++ Sin error";
//BA.debugLineNum = 257;BA.debugLine="If todoBienFLP Then LogColor(\" +++ +++ Sin error";
if (_todobienflp) {
anywheresoftware.b4a.keywords.Common.LogImpl("330081060"," +++ +++ Sin errores en FLP",anywheresoftware.b4a.keywords.Common.Colors.Green);};
anywheresoftware.b4a.keywords.Common.LogImpl("366388004"," +++ +++ Sin errores en FLP",anywheresoftware.b4a.keywords.Common.Colors.Green);};
}
catch (Exception e35) {
processBA.setLastException(e35);RDebugUtils.currentLine=30081062;
//BA.debugLineNum = 30081062;BA.debugLine="LogColor(\"If Tracker.FLP.IsInitialized --> \"&Las";
anywheresoftware.b4a.keywords.Common.LogImpl("330081062","If Tracker.FLP.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
processBA.setLastException(e35); //BA.debugLineNum = 259;BA.debugLine="LogColor(\"If Tracker.FLP.IsInitialized --> \"&Las";
anywheresoftware.b4a.keywords.Common.LogImpl("366388006","If Tracker.FLP.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
};
RDebugUtils.currentLine=30081065;
//BA.debugLineNum = 30081065;BA.debugLine="End Sub";
//BA.debugLineNum = 262;BA.debugLine="End Sub";
return "";
}
public static String _revisauug() throws Exception{
int _daa = 0;
//BA.debugLineNum = 266;BA.debugLine="Sub revisaUUG 'ignore";
//BA.debugLineNum = 267;BA.debugLine="Try";
try { //BA.debugLineNum = 269;BA.debugLine="If FLP.IsInitialized And FLP.IsConnected Then";
if (_flp.IsInitialized() && _flp.IsConnected()) {
//BA.debugLineNum = 270;BA.debugLine="Try";
try { //BA.debugLineNum = 271;BA.debugLine="If FLP.GetLastKnownLocation.IsInitialized Then";
if (_flp.GetLastKnownLocation().IsInitialized()) {
//BA.debugLineNum = 273;BA.debugLine="Dim daa As Int = UUGCoords.DistanceTo(FLP.Get";
_daa = (int) (_uugcoords.DistanceTo((android.location.Location)(_flp.GetLastKnownLocation().getObject())));
//BA.debugLineNum = 274;BA.debugLine="If Starter.Logger Then LogColor($\"**** UUC \"$";
if (mostCurrent._starter._logger /*boolean*/ ) {
anywheresoftware.b4a.keywords.Common.LogImpl("366453512",("**** UUC \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._subs._fechakmt /*String*/ (processBA,BA.NumberToString(_flp.GetLastKnownLocation().getTime()))))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.2",(Object)(_flp.GetLastKnownLocation().getAccuracy()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.8",(Object)(_flp.GetLastKnownLocation().getLatitude()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.8",(Object)(_flp.GetLastKnownLocation().getLongitude()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.2",(Object)(_flp.GetLastKnownLocation().getSpeed()))+"|"),anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (255),(int) (112),(int) (35)));};
//BA.debugLineNum = 275;BA.debugLine="If daa > 40 And FLP.GetLastKnownLocation.Accu";
if (_daa>40 && _flp.GetLastKnownLocation().getAccuracy()<35) {
//BA.debugLineNum = 276;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT";
mostCurrent._b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (processBA)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO RUTA_GPS(fecha, lat, lon) VALUES (?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(mostCurrent._subs._fechakmt /*String*/ (processBA,BA.NumberToString(_flp.GetLastKnownLocation().getTime()))),(Object)(_flp.GetLastKnownLocation().getLatitude()),(Object)(_flp.GetLastKnownLocation().getLongitude())}));
//BA.debugLineNum = 277;BA.debugLine="If Starter.Logger Then Log(\"++++ Distancia a";
if (mostCurrent._starter._logger /*boolean*/ ) {
anywheresoftware.b4a.keywords.Common.LogImpl("366453515","++++ Distancia a anterior="+BA.NumberToString(_daa)+"|"+"Precision="+BA.NumberToString(_flp.GetLastKnownLocation().getAccuracy()),0);};
};
//BA.debugLineNum = 279;BA.debugLine="UUGCoords = FLP.GetLastKnownLocation";
_uugcoords = _flp.GetLastKnownLocation();
};
}
catch (Exception e14) {
processBA.setLastException(e14); //BA.debugLineNum = 282;BA.debugLine="LogColor(\"FLP.GetLastKnownLocation.IsInitializ";
anywheresoftware.b4a.keywords.Common.LogImpl("366453520","FLP.GetLastKnownLocation.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
};
}else {
//BA.debugLineNum = 285;BA.debugLine="Log(\"StartFLP\")";
anywheresoftware.b4a.keywords.Common.LogImpl("366453523","StartFLP",0);
//BA.debugLineNum = 286;BA.debugLine="StartFLP";
_startflp();
};
}
catch (Exception e21) {
processBA.setLastException(e21); //BA.debugLineNum = 289;BA.debugLine="LogColor(\"If FLP.IsInitialized --> \"&LastExcepti";
anywheresoftware.b4a.keywords.Common.LogImpl("366453527","If FLP.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
};
//BA.debugLineNum = 291;BA.debugLine="End Sub";
return "";
}
public static String _service_create() throws Exception{
//BA.debugLineNum = 41;BA.debugLine="Sub Service_Create";
//BA.debugLineNum = 42;BA.debugLine="Service.AutomaticForegroundMode = Service.AUTOMAT";
mostCurrent._service.AutomaticForegroundMode = mostCurrent._service.AUTOMATIC_FOREGROUND_NEVER;
//BA.debugLineNum = 44;BA.debugLine="FLP.Initialize(\"flp\")";
_flp.Initialize(processBA,"flp");
//BA.debugLineNum = 45;BA.debugLine="FLP.Connect";
_flp.Connect();
//BA.debugLineNum = 46;BA.debugLine="lock.PartialLock";
_lock.PartialLock(processBA);
//BA.debugLineNum = 47;BA.debugLine="StartFLP";
_startflp();
//BA.debugLineNum = 48;BA.debugLine="End Sub";
return "";
}
public static String _service_destroy() throws Exception{
//BA.debugLineNum = 202;BA.debugLine="Sub Service_Destroy";
//BA.debugLineNum = 203;BA.debugLine="If Tracking Then";
if (_tracking) {
//BA.debugLineNum = 204;BA.debugLine="StopFLP";
_stopflp();
};
//BA.debugLineNum = 206;BA.debugLine="Tracking = False";
_tracking = anywheresoftware.b4a.keywords.Common.False;
//BA.debugLineNum = 207;BA.debugLine="lock.ReleasePartialLock";
_lock.ReleasePartialLock();
//BA.debugLineNum = 208;BA.debugLine="End Sub";
return "";
}
public static String _service_start(anywheresoftware.b4a.objects.IntentWrapper _startingintent) throws Exception{
//BA.debugLineNum = 59;BA.debugLine="Sub Service_Start (StartingIntent As Intent)";
//BA.debugLineNum = 61;BA.debugLine="Service.StopAutomaticForeground";
mostCurrent._service.StopAutomaticForeground();
//BA.debugLineNum = 62;BA.debugLine="Service.StartForeground(nid, CreateNotification(\"";
mostCurrent._service.StartForeground(_nid,(android.app.Notification)(_createnotification("...").getObject()));
//BA.debugLineNum = 63;BA.debugLine="Track";
_track();
//BA.debugLineNum = 64;BA.debugLine="StartServiceAt(Me, DateTime.Now + 5 * DateTime.Ti";
anywheresoftware.b4a.keywords.Common.StartServiceAt(processBA,tracker.getObject(),(long) (anywheresoftware.b4a.keywords.Common.DateTime.getNow()+5*anywheresoftware.b4a.keywords.Common.DateTime.TicksPerMinute),anywheresoftware.b4a.keywords.Common.True);
//BA.debugLineNum = 65;BA.debugLine="FLP.GetLastKnownLocation.Initialize";
_flp.GetLastKnownLocation().Initialize();
//BA.debugLineNum = 66;BA.debugLine="End Sub";
return "";
}
public static void _startflp() throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "startflp", false))
{Debug.delegate(processBA, "startflp", null); return;}
ResumableSub_StartFLP rsub = new ResumableSub_StartFLP(null);
rsub.resume(processBA, null);
}
@@ -492,7 +480,6 @@ keymon.lat.medicomed.tracker parent;
@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="tracker";
while (true) {
switch (state) {
@@ -502,8 +489,7 @@ return;
case 0:
//C
this.state = 1;
RDebugUtils.currentLine=29425666;
//BA.debugLineNum = 29425666;BA.debugLine="Do While FLP.IsConnected = False";
//BA.debugLineNum = 86;BA.debugLine="Do While FLP.IsConnected = False";
if (true) break;
case 1:
@@ -518,9 +504,8 @@ if (true) break;
case 3:
//C
this.state = 1;
RDebugUtils.currentLine=29425667;
//BA.debugLineNum = 29425667;BA.debugLine="Sleep(500)";
anywheresoftware.b4a.keywords.Common.Sleep(processBA,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "tracker", "startflp"),(int) (500));
//BA.debugLineNum = 87;BA.debugLine="Sleep(500)";
anywheresoftware.b4a.keywords.Common.Sleep(processBA,this,(int) (500));
this.state = 5;
return;
case 5:
@@ -533,221 +518,18 @@ case 4:
//C
this.state = -1;
;
RDebugUtils.currentLine=29425672;
//BA.debugLineNum = 29425672;BA.debugLine="FLP.RequestLocationUpdates(CreateLocationRequest)";
//BA.debugLineNum = 92;BA.debugLine="FLP.RequestLocationUpdates(CreateLocationRequest)";
parent._flp.RequestLocationUpdates((com.google.android.gms.location.LocationRequest)(_createlocationrequest().getObject()));
RDebugUtils.currentLine=29425675;
//BA.debugLineNum = 29425675;BA.debugLine="flpStarted = True";
//BA.debugLineNum = 95;BA.debugLine="flpStarted = True";
parent._flpstarted = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=29425677;
//BA.debugLineNum = 29425677;BA.debugLine="End Sub";
//BA.debugLineNum = 97;BA.debugLine="End Sub";
if (true) break;
}
}
}
}
public static String _revisauug() throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "revisauug", false))
{return ((String) Debug.delegate(processBA, "revisauug", null));}
int _daa = 0;
RDebugUtils.currentLine=30146560;
//BA.debugLineNum = 30146560;BA.debugLine="Sub revisaUUG 'ignore";
RDebugUtils.currentLine=30146561;
//BA.debugLineNum = 30146561;BA.debugLine="Try";
try {RDebugUtils.currentLine=30146563;
//BA.debugLineNum = 30146563;BA.debugLine="If FLP.IsInitialized And FLP.IsConnected Then";
if (_flp.IsInitialized() && _flp.IsConnected()) {
RDebugUtils.currentLine=30146564;
//BA.debugLineNum = 30146564;BA.debugLine="Try";
try {RDebugUtils.currentLine=30146565;
//BA.debugLineNum = 30146565;BA.debugLine="If FLP.GetLastKnownLocation.IsInitialized Then";
if (_flp.GetLastKnownLocation().IsInitialized()) {
RDebugUtils.currentLine=30146567;
//BA.debugLineNum = 30146567;BA.debugLine="Dim daa As Int = UUGCoords.DistanceTo(FLP.Get";
_daa = (int) (_uugcoords.DistanceTo((android.location.Location)(_flp.GetLastKnownLocation().getObject())));
RDebugUtils.currentLine=30146568;
//BA.debugLineNum = 30146568;BA.debugLine="If Starter.Logger Then LogColor($\"**** UUC \"$";
if (mostCurrent._starter._logger /*boolean*/ ) {
anywheresoftware.b4a.keywords.Common.LogImpl("330146568",("**** UUC \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._subs._fechakmt /*String*/ (processBA,BA.NumberToString(_flp.GetLastKnownLocation().getTime()))))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.2",(Object)(_flp.GetLastKnownLocation().getAccuracy()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.8",(Object)(_flp.GetLastKnownLocation().getLatitude()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.8",(Object)(_flp.GetLastKnownLocation().getLongitude()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.2",(Object)(_flp.GetLastKnownLocation().getSpeed()))+"|"),anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (255),(int) (112),(int) (35)));};
RDebugUtils.currentLine=30146569;
//BA.debugLineNum = 30146569;BA.debugLine="If daa > 40 And FLP.GetLastKnownLocation.Accu";
if (_daa>40 && _flp.GetLastKnownLocation().getAccuracy()<35) {
RDebugUtils.currentLine=30146570;
//BA.debugLineNum = 30146570;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT";
mostCurrent._b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (processBA)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO RUTA_GPS(fecha, lat, lon) VALUES (?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(mostCurrent._subs._fechakmt /*String*/ (processBA,BA.NumberToString(_flp.GetLastKnownLocation().getTime()))),(Object)(_flp.GetLastKnownLocation().getLatitude()),(Object)(_flp.GetLastKnownLocation().getLongitude())}));
RDebugUtils.currentLine=30146571;
//BA.debugLineNum = 30146571;BA.debugLine="If Starter.Logger Then Log(\"++++ Distancia a";
if (mostCurrent._starter._logger /*boolean*/ ) {
anywheresoftware.b4a.keywords.Common.LogImpl("330146571","++++ Distancia a anterior="+BA.NumberToString(_daa)+"|"+"Precision="+BA.NumberToString(_flp.GetLastKnownLocation().getAccuracy()),0);};
};
RDebugUtils.currentLine=30146573;
//BA.debugLineNum = 30146573;BA.debugLine="UUGCoords = FLP.GetLastKnownLocation";
_uugcoords = _flp.GetLastKnownLocation();
};
}
catch (Exception e14) {
processBA.setLastException(e14);RDebugUtils.currentLine=30146576;
//BA.debugLineNum = 30146576;BA.debugLine="LogColor(\"FLP.GetLastKnownLocation.IsInitializ";
anywheresoftware.b4a.keywords.Common.LogImpl("330146576","FLP.GetLastKnownLocation.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
};
}else {
RDebugUtils.currentLine=30146579;
//BA.debugLineNum = 30146579;BA.debugLine="Log(\"StartFLP\")";
anywheresoftware.b4a.keywords.Common.LogImpl("330146579","StartFLP",0);
RDebugUtils.currentLine=30146580;
//BA.debugLineNum = 30146580;BA.debugLine="StartFLP";
_startflp();
};
}
catch (Exception e21) {
processBA.setLastException(e21);RDebugUtils.currentLine=30146583;
//BA.debugLineNum = 30146583;BA.debugLine="LogColor(\"If FLP.IsInitialized --> \"&LastExcepti";
anywheresoftware.b4a.keywords.Common.LogImpl("330146583","If FLP.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
};
RDebugUtils.currentLine=30146585;
//BA.debugLineNum = 30146585;BA.debugLine="End Sub";
return "";
}
public static String _service_create() throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "service_create", false))
{return ((String) Debug.delegate(processBA, "service_create", null));}
RDebugUtils.currentLine=29097984;
//BA.debugLineNum = 29097984;BA.debugLine="Sub Service_Create";
RDebugUtils.currentLine=29097985;
//BA.debugLineNum = 29097985;BA.debugLine="Service.AutomaticForegroundMode = Service.AUTOMAT";
mostCurrent._service.AutomaticForegroundMode = mostCurrent._service.AUTOMATIC_FOREGROUND_NEVER;
RDebugUtils.currentLine=29097987;
//BA.debugLineNum = 29097987;BA.debugLine="FLP.Initialize(\"flp\")";
_flp.Initialize(processBA,"flp");
RDebugUtils.currentLine=29097988;
//BA.debugLineNum = 29097988;BA.debugLine="FLP.Connect";
_flp.Connect();
RDebugUtils.currentLine=29097989;
//BA.debugLineNum = 29097989;BA.debugLine="lock.PartialLock";
_lock.PartialLock(processBA);
RDebugUtils.currentLine=29097990;
//BA.debugLineNum = 29097990;BA.debugLine="StartFLP";
_startflp();
RDebugUtils.currentLine=29097991;
//BA.debugLineNum = 29097991;BA.debugLine="End Sub";
return "";
}
public static String _service_destroy() throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "service_destroy", false))
{return ((String) Debug.delegate(processBA, "service_destroy", null));}
RDebugUtils.currentLine=29949952;
//BA.debugLineNum = 29949952;BA.debugLine="Sub Service_Destroy";
RDebugUtils.currentLine=29949953;
//BA.debugLineNum = 29949953;BA.debugLine="If Tracking Then";
if (_tracking) {
RDebugUtils.currentLine=29949954;
//BA.debugLineNum = 29949954;BA.debugLine="StopFLP";
_stopflp();
};
RDebugUtils.currentLine=29949956;
//BA.debugLineNum = 29949956;BA.debugLine="Tracking = False";
_tracking = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=29949957;
//BA.debugLineNum = 29949957;BA.debugLine="lock.ReleasePartialLock";
_lock.ReleasePartialLock();
RDebugUtils.currentLine=29949958;
//BA.debugLineNum = 29949958;BA.debugLine="End Sub";
return "";
}
public static String _stopflp() throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "stopflp", false))
{return ((String) Debug.delegate(processBA, "stopflp", null));}
RDebugUtils.currentLine=29753344;
//BA.debugLineNum = 29753344;BA.debugLine="Public Sub StopFLP";
RDebugUtils.currentLine=29753346;
//BA.debugLineNum = 29753346;BA.debugLine="If flpStarted Then";
if (_flpstarted) {
RDebugUtils.currentLine=29753347;
//BA.debugLineNum = 29753347;BA.debugLine="FLP.RemoveLocationUpdates 'Eliminamos todas las";
_flp.RemoveLocationUpdates();
RDebugUtils.currentLine=29753348;
//BA.debugLineNum = 29753348;BA.debugLine="flpStarted = False";
_flpstarted = anywheresoftware.b4a.keywords.Common.False;
};
RDebugUtils.currentLine=29753350;
//BA.debugLineNum = 29753350;BA.debugLine="End Sub";
return "";
}
public static String _service_start(anywheresoftware.b4a.objects.IntentWrapper _startingintent) throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "service_start", false))
{return ((String) Debug.delegate(processBA, "service_start", new Object[] {_startingintent}));}
RDebugUtils.currentLine=29294592;
//BA.debugLineNum = 29294592;BA.debugLine="Sub Service_Start (StartingIntent As Intent)";
RDebugUtils.currentLine=29294594;
//BA.debugLineNum = 29294594;BA.debugLine="Service.StopAutomaticForeground";
mostCurrent._service.StopAutomaticForeground();
RDebugUtils.currentLine=29294595;
//BA.debugLineNum = 29294595;BA.debugLine="Service.StartForeground(nid, CreateNotification(\"";
mostCurrent._service.StartForeground(_nid,(android.app.Notification)(_createnotification("...").getObject()));
RDebugUtils.currentLine=29294596;
//BA.debugLineNum = 29294596;BA.debugLine="Track";
_track();
RDebugUtils.currentLine=29294597;
//BA.debugLineNum = 29294597;BA.debugLine="StartServiceAt(Me, DateTime.Now + 5 * DateTime.Ti";
anywheresoftware.b4a.keywords.Common.StartServiceAt(processBA,tracker.getObject(),(long) (anywheresoftware.b4a.keywords.Common.DateTime.getNow()+5*anywheresoftware.b4a.keywords.Common.DateTime.TicksPerMinute),anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=29294598;
//BA.debugLineNum = 29294598;BA.debugLine="FLP.GetLastKnownLocation.Initialize";
_flp.GetLastKnownLocation().Initialize();
RDebugUtils.currentLine=29294599;
//BA.debugLineNum = 29294599;BA.debugLine="End Sub";
return "";
}
public static String _track() throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "track", false))
{return ((String) Debug.delegate(processBA, "track", null));}
RDebugUtils.currentLine=29360128;
//BA.debugLineNum = 29360128;BA.debugLine="Public Sub Track";
RDebugUtils.currentLine=29360130;
//BA.debugLineNum = 29360130;BA.debugLine="If Not(FLP.IsInitialized) Then FLP.Initialize(\"fl";
if (anywheresoftware.b4a.keywords.Common.Not(_flp.IsInitialized())) {
_flp.Initialize(processBA,"flp");};
RDebugUtils.currentLine=29360131;
//BA.debugLineNum = 29360131;BA.debugLine="If Not(FLP.IsConnected) Then FLP.Connect";
if (anywheresoftware.b4a.keywords.Common.Not(_flp.IsConnected())) {
_flp.Connect();};
RDebugUtils.currentLine=29360132;
//BA.debugLineNum = 29360132;BA.debugLine="If Tracking And actualLR.IsInitialized Then";
if (_tracking && _actuallr.IsInitialized()) {
RDebugUtils.currentLine=29360134;
//BA.debugLineNum = 29360134;BA.debugLine="Return 'Si ya estamos \"rastreando\" no hacemos na";
if (true) return "";
};
RDebugUtils.currentLine=29360136;
//BA.debugLineNum = 29360136;BA.debugLine="If Starter.rp.Check(Starter.rp.PERMISSION_ACCESS_";
if (mostCurrent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .Check(mostCurrent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .PERMISSION_ACCESS_FINE_LOCATION)==anywheresoftware.b4a.keywords.Common.False) {
RDebugUtils.currentLine=29360137;
//BA.debugLineNum = 29360137;BA.debugLine="Log(\"No permission\")";
anywheresoftware.b4a.keywords.Common.LogImpl("329360137","No permission",0);
RDebugUtils.currentLine=29360138;
//BA.debugLineNum = 29360138;BA.debugLine="Return";
if (true) return "";
};
RDebugUtils.currentLine=29360140;
//BA.debugLineNum = 29360140;BA.debugLine="StartFLP 'Iniciamos FusedLocationProvider";
_startflp();
RDebugUtils.currentLine=29360141;
//BA.debugLineNum = 29360141;BA.debugLine="Tracking = True";
_tracking = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=29360142;
//BA.debugLineNum = 29360142;BA.debugLine="End Sub";
return "";
}
public static void _startflpsmall() throws Exception{
RDebugUtils.currentModule="tracker";
if (Debug.shouldDelegate(processBA, "startflpsmall", false))
{Debug.delegate(processBA, "startflpsmall", null); return;}
ResumableSub_StartFLPSmall rsub = new ResumableSub_StartFLPSmall(null);
rsub.resume(processBA, null);
}
@@ -759,7 +541,6 @@ keymon.lat.medicomed.tracker parent;
@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="tracker";
while (true) {
switch (state) {
@@ -769,8 +550,7 @@ return;
case 0:
//C
this.state = 1;
RDebugUtils.currentLine=29491202;
//BA.debugLineNum = 29491202;BA.debugLine="Do While FLP.IsConnected = False";
//BA.debugLineNum = 101;BA.debugLine="Do While FLP.IsConnected = False";
if (true) break;
case 1:
@@ -785,36 +565,70 @@ if (true) break;
case 3:
//C
this.state = 1;
RDebugUtils.currentLine=29491203;
//BA.debugLineNum = 29491203;BA.debugLine="Sleep(500)";
anywheresoftware.b4a.keywords.Common.Sleep(processBA,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "tracker", "startflpsmall"),(int) (500));
//BA.debugLineNum = 102;BA.debugLine="Sleep(500)";
anywheresoftware.b4a.keywords.Common.Sleep(processBA,this,(int) (500));
this.state = 5;
return;
case 5:
//C
this.state = 1;
;
RDebugUtils.currentLine=29491204;
//BA.debugLineNum = 29491204;BA.debugLine="Log(\"sleeping\")";
anywheresoftware.b4a.keywords.Common.LogImpl("329491204","sleeping",0);
//BA.debugLineNum = 103;BA.debugLine="Log(\"sleeping\")";
anywheresoftware.b4a.keywords.Common.LogImpl("365798148","sleeping",0);
if (true) break;
case 4:
//C
this.state = -1;
;
RDebugUtils.currentLine=29491206;
//BA.debugLineNum = 29491206;BA.debugLine="dameUltimaUbicacionConocida 'Regresamos ultima ub";
//BA.debugLineNum = 105;BA.debugLine="dameUltimaUbicacionConocida 'Regresamos ultima ub";
_dameultimaubicacionconocida();
RDebugUtils.currentLine=29491207;
//BA.debugLineNum = 29491207;BA.debugLine="FLP.RequestLocationUpdates(CreateLocationRequestS";
//BA.debugLineNum = 106;BA.debugLine="FLP.RequestLocationUpdates(CreateLocationRequestS";
parent._flp.RequestLocationUpdates((com.google.android.gms.location.LocationRequest)(_createlocationrequestsmalld().getObject()));
RDebugUtils.currentLine=29491210;
//BA.debugLineNum = 29491210;BA.debugLine="End Sub";
//BA.debugLineNum = 109;BA.debugLine="End Sub";
if (true) break;
}
}
}
}
}
public static String _stopflp() throws Exception{
//BA.debugLineNum = 146;BA.debugLine="Public Sub StopFLP";
//BA.debugLineNum = 148;BA.debugLine="If flpStarted Then";
if (_flpstarted) {
//BA.debugLineNum = 149;BA.debugLine="FLP.RemoveLocationUpdates 'Eliminamos todas las";
_flp.RemoveLocationUpdates();
//BA.debugLineNum = 150;BA.debugLine="flpStarted = False";
_flpstarted = anywheresoftware.b4a.keywords.Common.False;
};
//BA.debugLineNum = 152;BA.debugLine="End Sub";
return "";
}
public static String _track() throws Exception{
//BA.debugLineNum = 68;BA.debugLine="Public Sub Track";
//BA.debugLineNum = 70;BA.debugLine="If Not(FLP.IsInitialized) Then FLP.Initialize(\"fl";
if (anywheresoftware.b4a.keywords.Common.Not(_flp.IsInitialized())) {
_flp.Initialize(processBA,"flp");};
//BA.debugLineNum = 71;BA.debugLine="If Not(FLP.IsConnected) Then FLP.Connect";
if (anywheresoftware.b4a.keywords.Common.Not(_flp.IsConnected())) {
_flp.Connect();};
//BA.debugLineNum = 72;BA.debugLine="If Tracking And actualLR.IsInitialized Then";
if (_tracking && _actuallr.IsInitialized()) {
//BA.debugLineNum = 74;BA.debugLine="Return 'Si ya estamos \"rastreando\" no hacemos na";
if (true) return "";
};
//BA.debugLineNum = 76;BA.debugLine="If Starter.rp.Check(Starter.rp.PERMISSION_ACCESS_";
if (mostCurrent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .Check(mostCurrent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .PERMISSION_ACCESS_FINE_LOCATION)==anywheresoftware.b4a.keywords.Common.False) {
//BA.debugLineNum = 77;BA.debugLine="Log(\"No permission\")";
anywheresoftware.b4a.keywords.Common.LogImpl("365667081","No permission",0);
//BA.debugLineNum = 78;BA.debugLine="Return";
if (true) return "";
};
//BA.debugLineNum = 80;BA.debugLine="StartFLP 'Iniciamos FusedLocationProvider";
_startflp();
//BA.debugLineNum = 81;BA.debugLine="Tracking = True";
_tracking = anywheresoftware.b4a.keywords.Common.True;
//BA.debugLineNum = 82;BA.debugLine="End Sub";
return "";
}
}