package reparto_izca.keymon.lat;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.objects.ServiceHelper;
import anywheresoftware.b4a.debug.*;

public class starter extends android.app.Service{
	public static class starter_BR extends android.content.BroadcastReceiver {

		@Override
		public void onReceive(android.content.Context context, android.content.Intent intent) {
            BA.LogInfo("** Receiver (starter) OnReceive **");
			android.content.Intent in = new android.content.Intent(context, starter.class);
			if (intent != null)
				in.putExtra("b4a_internal_intent", intent);
            ServiceHelper.StarterHelper.startServiceFromReceiver (context, in, true, anywheresoftware.b4a.ShellBA.class);
		}

	}
    static starter mostCurrent;
	public static BA processBA;
    private ServiceHelper _service;
    public static Class<?> getObject() {
		return starter.class;
	}
	@Override
	public void onCreate() {
        super.onCreate();
        mostCurrent = this;
        if (processBA == null) {
		    processBA = new anywheresoftware.b4a.ShellBA(this, null, null, "reparto_izca.keymon.lat", "reparto_izca.keymon.lat.starter");
            if (BA.isShellModeRuntimeCheck(processBA)) {
                processBA.raiseEvent2(null, true, "SHELL", false);
		    }
            try {
                Class.forName(BA.applicationContext.getPackageName() + ".main").getMethod("initializeProcessGlobals").invoke(null, null);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            processBA.loadHtSubs(this.getClass());
            ServiceHelper.init();
        }
        _service = new ServiceHelper(this);
        processBA.service = this;
        
        if (BA.isShellModeRuntimeCheck(processBA)) {
			processBA.raiseEvent2(null, true, "CREATE", true, "reparto_izca.keymon.lat.starter", processBA, _service, anywheresoftware.b4a.keywords.Common.Density);
		}
        if (!true && ServiceHelper.StarterHelper.startFromServiceCreate(processBA, false) == false) {
				
		}
		else {
            processBA.setActivityPaused(false);
            BA.LogInfo("*** Service (starter) Create ***");
            processBA.raiseEvent(null, "service_create");
        }
        processBA.runHook("oncreate", this, null);
        if (true) {
			if (ServiceHelper.StarterHelper.runWaitForLayouts() == false) {
                BA.LogInfo("stopping spontaneous created service");
                stopSelf();
            }
		}
    }
		@Override
	public void onStart(android.content.Intent intent, int startId) {
		onStartCommand(intent, 0, 0);
    }
    @Override
    public int onStartCommand(final android.content.Intent intent, int flags, int startId) {
    	if (ServiceHelper.StarterHelper.onStartCommand(processBA, new Runnable() {
            public void run() {
                handleStart(intent);
            }}))
			;
		else {
			ServiceHelper.StarterHelper.addWaitForLayout (new Runnable() {
				public void run() {
                    processBA.setActivityPaused(false);
                    BA.LogInfo("** Service (starter) Create **");
                    processBA.raiseEvent(null, "service_create");
					handleStart(intent);
                    ServiceHelper.StarterHelper.removeWaitForLayout();
				}
			});
		}
        processBA.runHook("onstartcommand", this, new Object[] {intent, flags, startId});
		return android.app.Service.START_NOT_STICKY;
    }
    public void onTaskRemoved(android.content.Intent rootIntent) {
        super.onTaskRemoved(rootIntent);
        if (true)
            processBA.raiseEvent(null, "service_taskremoved");
            
    }
    private void handleStart(android.content.Intent intent) {
    	BA.LogInfo("** Service (starter) Start **");
    	java.lang.reflect.Method startEvent = processBA.htSubs.get("service_start");
    	if (startEvent != null) {
    		if (startEvent.getParameterTypes().length > 0) {
    			anywheresoftware.b4a.objects.IntentWrapper iw = ServiceHelper.StarterHelper.handleStartIntent(intent, _service, processBA);
    			processBA.raiseEvent(null, "service_start", iw);
    		}
    		else {
    			processBA.raiseEvent(null, "service_start");
    		}
    	}
    }
	
	@Override
	public void onDestroy() {
        super.onDestroy();
        if (true) {
            BA.LogInfo("** Service (starter) Destroy (ignored)**");
        }
        else {
            BA.LogInfo("** Service (starter) Destroy **");
		    processBA.raiseEvent(null, "service_destroy");
            processBA.service = null;
		    mostCurrent = null;
		    processBA.setActivityPaused(true);
            processBA.runHook("ondestroy", this, null);
        }
	}

@Override
	public android.os.IBinder onBind(android.content.Intent intent) {
		return null;
	}
public anywheresoftware.b4a.keywords.Common __c = null;
public static anywheresoftware.b4a.objects.RuntimePermissions _rp = null;
public static uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper _flp = null;
public static boolean _flpstarted = false;
public static anywheresoftware.b4a.sql.SQL _skmt = null;
public static String _ruta = "";
public static anywheresoftware.b4a.objects.Serial.BluetoothAdmin _btadmin = null;
public static boolean _bluetoothstate = false;
public static anywheresoftware.b4a.objects.Timer _timer1 = null;
public static int _interval = 0;
public static String _trackeractividad = "";
public static String _pushserviceactividad = "";
public static String _mac_impresora = "";
public static anywheresoftware.b4a.keywords.StringBuilderWrapper _logs = null;
public static anywheresoftware.b4a.phone.Phone.LogCat _logcat = null;
public static String _sharedfolder = "";
public static anywheresoftware.b4a.gps.LocationWrapper _cedislocation = null;
public static reparto_izca.keymon.lat.dbrequestmanager _reqmanager = null;
public static String _server = "";
public static String _muestraprogreso = "";
public static anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public b4a.example.dateutils _dateutils = null;
public reparto_izca.keymon.lat.main _main = null;
public reparto_izca.keymon.lat.appupdater _appupdater = null;
public reparto_izca.keymon.lat.subs _subs = null;
public reparto_izca.keymon.lat.foto _foto = null;
public reparto_izca.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_izca.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_izca.keymon.lat.tracker _tracker = null;
public reparto_izca.keymon.lat.newinst2 _newinst2 = null;
public reparto_izca.keymon.lat.b4xpages _b4xpages = null;
public reparto_izca.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_izca.keymon.lat.httputils2service _httputils2service = null;
public reparto_izca.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public static String  _envia_ultima_gps() throws Exception{
RDebugUtils.currentModule="starter";
if (Debug.shouldDelegate(processBA, "envia_ultima_gps", false))
	 {return ((String) Debug.delegate(processBA, "envia_ultima_gps", null));}
reparto_izca.keymon.lat.dbrequestmanager._dbcommand _cmd = null;
RDebugUtils.currentLine=72810496;
 //BA.debugLineNum = 72810496;BA.debugLine="Sub ENVIA_ULTIMA_GPS";
RDebugUtils.currentLine=72810497;
 //BA.debugLineNum = 72810497;BA.debugLine="If IsConnectedToInternet Then";
if (_isconnectedtointernet()) { 
RDebugUtils.currentLine=72810498;
 //BA.debugLineNum = 72810498;BA.debugLine="Log(\"Con internet, enviamos UTR!\")";
anywheresoftware.b4a.keywords.Common.LogImpl("872810498","Con internet, enviamos UTR!",0);
RDebugUtils.currentLine=72810499;
 //BA.debugLineNum = 72810499;BA.debugLine="Dim skmt As SQL";
_skmt = new anywheresoftware.b4a.sql.SQL();
RDebugUtils.currentLine=72810500;
 //BA.debugLineNum = 72810500;BA.debugLine="Dim cmd As DBCommand";
_cmd = new reparto_izca.keymon.lat.dbrequestmanager._dbcommand();
RDebugUtils.currentLine=72810501;
 //BA.debugLineNum = 72810501;BA.debugLine="Dim reqManager As DBRequestManager";
_reqmanager = new reparto_izca.keymon.lat.dbrequestmanager();
RDebugUtils.currentLine=72810502;
 //BA.debugLineNum = 72810502;BA.debugLine="reqManager.Initialize(Me, server)";
_reqmanager._initialize /*String*/ (null,processBA,starter.getObject(),_server);
RDebugUtils.currentLine=72810504;
 //BA.debugLineNum = 72810504;BA.debugLine="skmt.Initialize(ruta,\"kmt.db\", True)";
_skmt.Initialize(_ruta,"kmt.db",anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=72810506;
 //BA.debugLineNum = 72810506;BA.debugLine="skmt.Initialize(ruta,\"kmt.db\", True)";
_skmt.Initialize(_ruta,"kmt.db",anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=72810514;
 //BA.debugLineNum = 72810514;BA.debugLine="If B4XPages.MainPage.logger Then LogColor(\"Inici";
if (mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("872810514","Iniciamos ENVIA_ULTIMA_GPS",anywheresoftware.b4a.keywords.Common.Colors.Red);};
RDebugUtils.currentLine=72810515;
 //BA.debugLineNum = 72810515;BA.debugLine="DateTime.TimeFormat = \"HHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setTimeFormat("HHmmss");
RDebugUtils.currentLine=72810516;
 //BA.debugLineNum = 72810516;BA.debugLine="B4XPages.MainPage.ultimaActualizacionGPS = DateT";
mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._ultimaactualizaciongps /*String*/  = anywheresoftware.b4a.keywords.Common.DateTime.Time(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=72810517;
 //BA.debugLineNum = 72810517;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
RDebugUtils.currentLine=72810518;
 //BA.debugLineNum = 72810518;BA.debugLine="cmd.Name = \"select_fechat\"";
_cmd.Name /*String*/  = "select_fechat";
RDebugUtils.currentLine=72810519;
 //BA.debugLineNum = 72810519;BA.debugLine="reqManager.ExecuteQuery(cmd , 0, \"fechat\")";
_reqmanager._executequery /*String*/ (null,_cmd,(int) (0),(Object)("fechat"));
RDebugUtils.currentLine=72810521;
 //BA.debugLineNum = 72810521;BA.debugLine="Log(B4XPages.MainPage.montoActual&\"  ,  \" &B4XPa";
anywheresoftware.b4a.keywords.Common.LogImpl("872810521",mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._montoactual /*String*/ +"  ,  "+mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._clientestotal /*String*/ +"  ,  "+mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._visitadostotales /*String*/ +"  ,  "+mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._monto_entregadoactual /*String*/ +"  ,  "+mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._entregas /*String*/ +"  ,  "+mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._porvisitar /*String*/ +"  ,  "+mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._rechazos /*String*/ +"  ,  "+mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._lat_gps /*String*/ +"  ,  "+mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._lon_gps /*String*/ +"  ,  "+BA.NumberToString(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._batt /*int*/ )+"  ,  "+anywheresoftware.b4a.keywords.Common.Application.getVersionName()+"  ,  "+mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._almacen /*String*/ +"  ,  "+mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._rutapreventa /*String*/ ,0);
RDebugUtils.currentLine=72810522;
 //BA.debugLineNum = 72810522;BA.debugLine="Dim cmd As DBCommand";
_cmd = new reparto_izca.keymon.lat.dbrequestmanager._dbcommand();
RDebugUtils.currentLine=72810523;
 //BA.debugLineNum = 72810523;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
RDebugUtils.currentLine=72810524;
 //BA.debugLineNum = 72810524;BA.debugLine="cmd.Name = \"UPDATE_IZCA_ACTUALR2_GPS\"";
_cmd.Name /*String*/  = "UPDATE_IZCA_ACTUALR2_GPS";
RDebugUtils.currentLine=72810526;
 //BA.debugLineNum = 72810526;BA.debugLine="cmd.Parameters = Array As Object(B4XPages.MainPa";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._montoactual /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._clientestotal /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._visitadostotales /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._monto_entregadoactual /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._entregas /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._porvisitar /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._rechazos /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._lat_gps /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._lon_gps /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._batt /*int*/ ),(Object)(anywheresoftware.b4a.keywords.Common.Application.getVersionName()),(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._almacen /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._rutapreventa /*String*/ )};
RDebugUtils.currentLine=72810527;
 //BA.debugLineNum = 72810527;BA.debugLine="If B4XPages.MainPage.logger Then Log($\"montoActu";
if (mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("872810527",("montoActual: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._montoactual /*String*/ ))+", cTotal: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._clientestotal /*String*/ ))+", cVenta: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._clientesventa /*String*/ ))+", cVisitados: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._clientesvisitados /*String*/ ))+", "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._lat_gps /*String*/ ))+", "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._lon_gps /*String*/ ))+", Batt: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._batt /*int*/ ))+", montoRechazado: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._montorechazado /*String*/ ))+", montoEntregado: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._montoentregado /*String*/ ))+", porVisitar: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._porvisitar /*String*/ ))+", entregas: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._entregas /*String*/ ))+", rechazos: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._rechazos /*String*/ ))+", Almacen: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._almacen /*String*/ ))+", Ruta: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (processBA)._rutapreventa /*String*/ ))+""),0);};
RDebugUtils.currentLine=72810529;
 //BA.debugLineNum = 72810529;BA.debugLine="reqManager.ExecuteCommand(cmd, \"inst_visitas\")";
_reqmanager._executecommand /*String*/ (null,_cmd,(Object)("inst_visitas"));
RDebugUtils.currentLine=72810530;
 //BA.debugLineNum = 72810530;BA.debugLine="skmt.ExecNonQuery2(\"Update cat_variables set CAT";
_skmt.ExecNonQuery2("Update cat_variables set CAT_VA_VALOR = ?  WHERE CAT_VA_DESCRIPCION = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{anywheresoftware.b4a.keywords.Common.DateTime.Time(anywheresoftware.b4a.keywords.Common.DateTime.getNow()),"HoraIngreso"}));
RDebugUtils.currentLine=72810533;
 //BA.debugLineNum = 72810533;BA.debugLine="Timer1.Enabled = False";
_timer1.setEnabled(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=72810534;
 //BA.debugLineNum = 72810534;BA.debugLine="Timer1.Interval = Interval * 1000";
_timer1.setInterval((long) (_interval*1000));
RDebugUtils.currentLine=72810535;
 //BA.debugLineNum = 72810535;BA.debugLine="Timer1.Enabled = True";
_timer1.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 }else {
RDebugUtils.currentLine=72810537;
 //BA.debugLineNum = 72810537;BA.debugLine="Log(\"Sin conexión a internet, no se envió UTR!\")";
anywheresoftware.b4a.keywords.Common.LogImpl("872810537","Sin conexión a internet, no se envió UTR!",0);
 };
RDebugUtils.currentLine=72810539;
 //BA.debugLineNum = 72810539;BA.debugLine="End Sub";
return "";
}
public static boolean  _application_error(anywheresoftware.b4a.objects.B4AException _error,String _stacktrace) throws Exception{
RDebugUtils.currentModule="starter";
if (Debug.shouldDelegate(processBA, "application_error", false))
	 {return ((Boolean) Debug.delegate(processBA, "application_error", new Object[] {_error,_stacktrace}));}
RDebugUtils.currentLine=72613888;
 //BA.debugLineNum = 72613888;BA.debugLine="Sub Application_Error (Error As Exception, StackTr";
RDebugUtils.currentLine=72613889;
 //BA.debugLineNum = 72613889;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=72613890;
 //BA.debugLineNum = 72613890;BA.debugLine="End Sub";
return false;
}
public static boolean  _isconnectedtointernet() throws Exception{
RDebugUtils.currentModule="starter";
if (Debug.shouldDelegate(processBA, "isconnectedtointernet", false))
	 {return ((Boolean) Debug.delegate(processBA, "isconnectedtointernet", null));}
anywheresoftware.b4a.agraham.reflection.Reflection _r = null;
RDebugUtils.currentLine=72876032;
 //BA.debugLineNum = 72876032;BA.debugLine="Sub IsConnectedToInternet As Boolean 'ignore";
RDebugUtils.currentLine=72876033;
 //BA.debugLineNum = 72876033;BA.debugLine="Dim r As Reflector";
_r = new anywheresoftware.b4a.agraham.reflection.Reflection();
RDebugUtils.currentLine=72876034;
 //BA.debugLineNum = 72876034;BA.debugLine="r.Target = r.GetContext";
_r.Target = (Object)(_r.GetContext(processBA));
RDebugUtils.currentLine=72876035;
 //BA.debugLineNum = 72876035;BA.debugLine="r.Target = r.RunMethod2(\"getSystemService\", \"conn";
_r.Target = _r.RunMethod2("getSystemService","connectivity","java.lang.String");
RDebugUtils.currentLine=72876036;
 //BA.debugLineNum = 72876036;BA.debugLine="r.Target = r.RunMethod(\"getActiveNetworkInfo\")";
_r.Target = _r.RunMethod("getActiveNetworkInfo");
RDebugUtils.currentLine=72876037;
 //BA.debugLineNum = 72876037;BA.debugLine="If r.Target <> Null Then";
if (_r.Target!= null) { 
RDebugUtils.currentLine=72876038;
 //BA.debugLineNum = 72876038;BA.debugLine="Return r.RunMethod(\"isConnectedOrConnecting\")";
if (true) return BA.ObjectToBoolean(_r.RunMethod("isConnectedOrConnecting"));
 };
RDebugUtils.currentLine=72876040;
 //BA.debugLineNum = 72876040;BA.debugLine="Return False";
if (true) return anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=72876041;
 //BA.debugLineNum = 72876041;BA.debugLine="End Sub";
return false;
}
public static String  _jobdone(reparto_izca.keymon.lat.httpjob _job) throws Exception{
RDebugUtils.currentModule="starter";
if (Debug.shouldDelegate(processBA, "jobdone", false))
	 {return ((String) Debug.delegate(processBA, "jobdone", new Object[] {_job}));}
RDebugUtils.currentLine=72941568;
 //BA.debugLineNum = 72941568;BA.debugLine="Sub JobDone(Job As HttpJob)";
RDebugUtils.currentLine=72941572;
 //BA.debugLineNum = 72941572;BA.debugLine="If Job.Success = False Then";
if (_job._success /*boolean*/ ==anywheresoftware.b4a.keywords.Common.False) { 
RDebugUtils.currentLine=72941574;
 //BA.debugLineNum = 72941574;BA.debugLine="If Job.ErrorMessage.Contains(\"failed to connect\"";
if (_job._errormessage /*String*/ .contains("failed to connect") || _job._errormessage /*String*/ .contains("Failed to connect")) { 
RDebugUtils.currentLine=72941575;
 //BA.debugLineNum = 72941575;BA.debugLine="ToastMessageShow(\"!Hubo un error contactando al";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("!Hubo un error contactando al servidor, por favor revise su conexión!"),anywheresoftware.b4a.keywords.Common.True);
 };
 }else {
 };
RDebugUtils.currentLine=72941581;
 //BA.debugLineNum = 72941581;BA.debugLine="End Sub";
return "";
}
public static String  _service_create() throws Exception{
RDebugUtils.currentModule="starter";
if (Debug.shouldDelegate(processBA, "service_create", false))
	 {return ((String) Debug.delegate(processBA, "service_create", null));}
RDebugUtils.currentLine=72417280;
 //BA.debugLineNum = 72417280;BA.debugLine="Sub Service_Create";
RDebugUtils.currentLine=72417283;
 //BA.debugLineNum = 72417283;BA.debugLine="ruta = File.DirInternal 'Ruta de la base de datos";
_ruta = anywheresoftware.b4a.keywords.Common.File.getDirInternal();
RDebugUtils.currentLine=72417285;
 //BA.debugLineNum = 72417285;BA.debugLine="If Not(File.Exists(ruta, \"kmt.db\")) Then File.Cop";
if (anywheresoftware.b4a.keywords.Common.Not(anywheresoftware.b4a.keywords.Common.File.Exists(_ruta,"kmt.db"))) { 
anywheresoftware.b4a.keywords.Common.File.Copy(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"kmt.db",_ruta,"kmt.db");};
RDebugUtils.currentLine=72417286;
 //BA.debugLineNum = 72417286;BA.debugLine="Log(ruta)";
anywheresoftware.b4a.keywords.Common.LogImpl("872417286",_ruta,0);
RDebugUtils.currentLine=72417287;
 //BA.debugLineNum = 72417287;BA.debugLine="skmt.Initialize(ruta,\"kmt.db\", True)";
_skmt.Initialize(_ruta,"kmt.db",anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=72417301;
 //BA.debugLineNum = 72417301;BA.debugLine="Timer1.Initialize(\"Timer1\", Interval * 1000)";
_timer1.Initialize(processBA,"Timer1",(long) (_interval*1000));
RDebugUtils.currentLine=72417302;
 //BA.debugLineNum = 72417302;BA.debugLine="Timer1.Enabled = True";
_timer1.setEnabled(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=72417303;
 //BA.debugLineNum = 72417303;BA.debugLine="SharedFolder = rp.GetSafeDirDefaultExternal(\"\")";
_sharedfolder = _rp.GetSafeDirDefaultExternal("");
RDebugUtils.currentLine=72417304;
 //BA.debugLineNum = 72417304;BA.debugLine="cedisLocation.Initialize";
_cedislocation.Initialize();
RDebugUtils.currentLine=72417307;
 //BA.debugLineNum = 72417307;BA.debugLine="cedisLocation.Latitude = \"0\"";
_cedislocation.setLatitude((double)(Double.parseDouble("0")));
RDebugUtils.currentLine=72417308;
 //BA.debugLineNum = 72417308;BA.debugLine="cedisLocation.Longitude = \"0\"";
_cedislocation.setLongitude((double)(Double.parseDouble("0")));
RDebugUtils.currentLine=72417309;
 //BA.debugLineNum = 72417309;BA.debugLine="End Sub";
return "";
}
public static String  _service_destroy() throws Exception{
RDebugUtils.currentModule="starter";
if (Debug.shouldDelegate(processBA, "service_destroy", false))
	 {return ((String) Debug.delegate(processBA, "service_destroy", null));}
RDebugUtils.currentLine=72679424;
 //BA.debugLineNum = 72679424;BA.debugLine="Sub Service_Destroy";
RDebugUtils.currentLine=72679426;
 //BA.debugLineNum = 72679426;BA.debugLine="End Sub";
return "";
}
public static String  _service_start(anywheresoftware.b4a.objects.IntentWrapper _startingintent) throws Exception{
RDebugUtils.currentModule="starter";
if (Debug.shouldDelegate(processBA, "service_start", false))
	 {return ((String) Debug.delegate(processBA, "service_start", new Object[] {_startingintent}));}
RDebugUtils.currentLine=72482816;
 //BA.debugLineNum = 72482816;BA.debugLine="Sub Service_Start (StartingIntent As Intent)";
RDebugUtils.currentLine=72482817;
 //BA.debugLineNum = 72482817;BA.debugLine="Service.StopAutomaticForeground 'Starter service";
mostCurrent._service.StopAutomaticForeground();
RDebugUtils.currentLine=72482821;
 //BA.debugLineNum = 72482821;BA.debugLine="End Sub";
return "";
}
public static String  _service_taskremoved() throws Exception{
RDebugUtils.currentModule="starter";
if (Debug.shouldDelegate(processBA, "service_taskremoved", false))
	 {return ((String) Debug.delegate(processBA, "service_taskremoved", null));}
RDebugUtils.currentLine=72548352;
 //BA.debugLineNum = 72548352;BA.debugLine="Sub Service_TaskRemoved";
RDebugUtils.currentLine=72548354;
 //BA.debugLineNum = 72548354;BA.debugLine="End Sub";
return "";
}
public static String  _timer1_tick() throws Exception{
RDebugUtils.currentModule="starter";
if (Debug.shouldDelegate(processBA, "timer1_tick", false))
	 {return ((String) Debug.delegate(processBA, "timer1_tick", null));}
RDebugUtils.currentLine=72744960;
 //BA.debugLineNum = 72744960;BA.debugLine="Private Sub Timer1_Tick";
RDebugUtils.currentLine=72744963;
 //BA.debugLineNum = 72744963;BA.debugLine="ENVIA_ULTIMA_GPS";
_envia_ultima_gps();
RDebugUtils.currentLine=72744964;
 //BA.debugLineNum = 72744964;BA.debugLine="End Sub";
return "";
}
}