package gunav2.keymon.com.mx;


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, "gunav2.keymon.com.mx", "gunav2.keymon.com.mx.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, "gunav2.keymon.com.mx.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.gps.GPS _gps = null;
public static anywheresoftware.b4a.phone.Phone _ph = null;
public static anywheresoftware.b4a.sql.SQL _skmt = null;
public static anywheresoftware.b4a.objects.RuntimePermissions _rp = null;
public static uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper _flp = null;
public static gunav2.keymon.com.mx.dbrequestmanager _reqmanager = null;
public static String _server = "";
public static anywheresoftware.b4a.objects.Timer _timer1 = null;
public static int _interval = 0;
public static String _ruta = "";
public static anywheresoftware.b4a.keywords.StringBuilderWrapper _logs = null;
public static anywheresoftware.b4a.phone.Phone.LogCat _logcat = null;
public static boolean _logger = false;
public static String _marcacel = "";
public static anywheresoftware.b4a.objects.Serial.BluetoothAdmin _btadmin = null;
public static String _mac_impresora = "";
public static boolean _bluetoothstate = false;
public static anywheresoftware.b4a.gps.LocationWrapper _ubicacionactual = null;
public static boolean _enventa = false;
public static String _muestraprogreso = "";
public static gunav2.keymon.com.mx.appupdater._mnewversion _newapp = null;
public static String _nuevolink = "";
public static String _idcliente = "";
public static String _encuesta = "";
public static gunav2.keymon.com.mx.fileprovider _ffileprovider = null;
public static String _tabla = "";
public static boolean _encliente = false;
public b4a.example.dateutils _dateutils = null;
public gunav2.keymon.com.mx.main _main = null;
public gunav2.keymon.com.mx.subs _subs = null;
public gunav2.keymon.com.mx.appupdater _appupdater = null;
public gunav2.keymon.com.mx.tracker _tracker = null;
public gunav2.keymon.com.mx.firebasemessaging _firebasemessaging = null;
public gunav2.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public gunav2.keymon.com.mx.newinst2 _newinst2 = null;
public gunav2.keymon.com.mx.b4xpages _b4xpages = null;
public gunav2.keymon.com.mx.b4xcollections _b4xcollections = null;
public gunav2.keymon.com.mx.httputils2service _httputils2service = null;
public gunav2.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
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}));}
anywheresoftware.b4j.object.JavaObject _jo = null;
long _l = 0L;
RDebugUtils.currentLine=983040;
 //BA.debugLineNum = 983040;BA.debugLine="Sub Application_Error (Error As Exception, StackTr";
RDebugUtils.currentLine=983042;
 //BA.debugLineNum = 983042;BA.debugLine="Dim jo As JavaObject";
_jo = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=983043;
 //BA.debugLineNum = 983043;BA.debugLine="Dim l As Long = 500: jo.InitializeStatic(\"java.la";
_l = (long) (500);
RDebugUtils.currentLine=983043;
 //BA.debugLineNum = 983043;BA.debugLine="Dim l As Long = 500: jo.InitializeStatic(\"java.la";
_jo.InitializeStatic("java.lang.Thread").RunMethod("sleep",new Object[]{(Object)(_l)});
RDebugUtils.currentLine=983044;
 //BA.debugLineNum = 983044;BA.debugLine="logcat.LogCatStop";
_logcat.LogCatStop();
RDebugUtils.currentLine=983045;
 //BA.debugLineNum = 983045;BA.debugLine="logs.Append(StackTrace)";
_logs.Append(_stacktrace);
RDebugUtils.currentLine=983046;
 //BA.debugLineNum = 983046;BA.debugLine="Subs.revisaBD";
mostCurrent._subs._revisabd /*String*/ (processBA);
RDebugUtils.currentLine=983047;
 //BA.debugLineNum = 983047;BA.debugLine="Subs.errorLog.ExecNonQuery2(\"INSERT INTO errores(";
mostCurrent._subs._errorlog /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO errores(fecha, error) VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(mostCurrent._subs._fechakmt /*String*/ (processBA,BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow()))),(Object)(_logs.getObject())}));
RDebugUtils.currentLine=983048;
 //BA.debugLineNum = 983048;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=983049;
 //BA.debugLineNum = 983049;BA.debugLine="End Sub";
return false;
}
public static String  _btadmin_statechanged(int _newstate,int _oldstate) throws Exception{
RDebugUtils.currentModule="starter";
if (Debug.shouldDelegate(processBA, "btadmin_statechanged", false))
	 {return ((String) Debug.delegate(processBA, "btadmin_statechanged", new Object[] {_newstate,_oldstate}));}
RDebugUtils.currentLine=458752;
 //BA.debugLineNum = 458752;BA.debugLine="Private Sub BTAdmin_StateChanged (NewState As Int,";
RDebugUtils.currentLine=458753;
 //BA.debugLineNum = 458753;BA.debugLine="If logger Then Log(\"BT state changed: \" & NewStat";
if (_logger) { 
anywheresoftware.b4a.keywords.Common.LogImpl("0458753","BT state changed: "+BA.NumberToString(_newstate),0);};
RDebugUtils.currentLine=458754;
 //BA.debugLineNum = 458754;BA.debugLine="BluetoothState = NewState = BTAdmin.STATE_ON";
_bluetoothstate = _newstate==_btadmin.STATE_ON;
RDebugUtils.currentLine=458756;
 //BA.debugLineNum = 458756;BA.debugLine="End Sub";
return "";
}
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));}
gunav2.keymon.com.mx.dbrequestmanager._dbcommand _cmd = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _s7 = null;
int _totalstick = 0;
int _sfsdf = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _s8 = null;
int _totalpaquete = 0;
RDebugUtils.currentLine=851968;
 //BA.debugLineNum = 851968;BA.debugLine="Sub ENVIA_ULTIMA_GPS";
RDebugUtils.currentLine=851969;
 //BA.debugLineNum = 851969;BA.debugLine="LogColor(\"Iniciamos ENVIA_ULTIMA_GPS\", Colors.Mag";
anywheresoftware.b4a.keywords.Common.LogImpl("0851969","Iniciamos ENVIA_ULTIMA_GPS",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=851970;
 //BA.debugLineNum = 851970;BA.debugLine="Dim skmt As SQL";
_skmt = new anywheresoftware.b4a.sql.SQL();
RDebugUtils.currentLine=851971;
 //BA.debugLineNum = 851971;BA.debugLine="Dim cmd As DBCommand";
_cmd = new gunav2.keymon.com.mx.dbrequestmanager._dbcommand();
RDebugUtils.currentLine=851972;
 //BA.debugLineNum = 851972;BA.debugLine="skmt.Initialize(ruta,\"kmt.db\", True)";
_skmt.Initialize(_ruta,"kmt.db",anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=851976;
 //BA.debugLineNum = 851976;BA.debugLine="Dim cmd As DBCommand";
_cmd = new gunav2.keymon.com.mx.dbrequestmanager._dbcommand();
RDebugUtils.currentLine=851977;
 //BA.debugLineNum = 851977;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
RDebugUtils.currentLine=851978;
 //BA.debugLineNum = 851978;BA.debugLine="cmd.Name = \"UPDATE_GUNA_ACTUAL2_GPS2\"";
_cmd.Name /*String*/  = "UPDATE_GUNA_ACTUAL2_GPS2";
RDebugUtils.currentLine=851979;
 //BA.debugLineNum = 851979;BA.debugLine="Private s7 As Cursor = B4XPages.MainPage.skmt.Exe";
_s7 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s7 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (processBA)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select SUM(PE_CANT) AS PE_CANT, PE_PROID FROM PEDIDO WHERE PE_PROID IN (SELECT CAT_GP_ID FROM CAT_GUNAPROD WHERE CAT_GP_TIPO = 'CIGARRO') GROUP BY PE_PROID")));
RDebugUtils.currentLine=851980;
 //BA.debugLineNum = 851980;BA.debugLine="If s7.RowCount > 0 Then";
if (_s7.getRowCount()>0) { 
RDebugUtils.currentLine=851981;
 //BA.debugLineNum = 851981;BA.debugLine="Dim totalstick As Int = 0";
_totalstick = (int) (0);
RDebugUtils.currentLine=851982;
 //BA.debugLineNum = 851982;BA.debugLine="For sfsdf = 0 To s7.RowCount -1";
{
final int step11 = 1;
final int limit11 = (int) (_s7.getRowCount()-1);
_sfsdf = (int) (0) ;
for (;_sfsdf <= limit11 ;_sfsdf = _sfsdf + step11 ) {
RDebugUtils.currentLine=851983;
 //BA.debugLineNum = 851983;BA.debugLine="s7.Position= sfsdf";
_s7.setPosition(_sfsdf);
RDebugUtils.currentLine=851984;
 //BA.debugLineNum = 851984;BA.debugLine="Log(\"ENTRE AQUI\")";
anywheresoftware.b4a.keywords.Common.LogImpl("0851984","ENTRE AQUI",0);
RDebugUtils.currentLine=851985;
 //BA.debugLineNum = 851985;BA.debugLine="Dim s8 As Cursor = B4XPages.MainPage.skmt.ExecQ";
_s8 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s8 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (processBA)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT ifnull(CAT_GP_CONVERSION3,0) as CAT_GP_CONVERSION3 FROM CAT_GUNAPROD WHERE CAT_GP_ID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_s7.GetString("PE_PROID")))+"'"))));
RDebugUtils.currentLine=851986;
 //BA.debugLineNum = 851986;BA.debugLine="s8.Position = 0";
_s8.setPosition((int) (0));
RDebugUtils.currentLine=851987;
 //BA.debugLineNum = 851987;BA.debugLine="totalstick = totalstick + (s7.GetString(\"PE_CAN";
_totalstick = (int) (_totalstick+((double)(Double.parseDouble(_s7.GetString("PE_CANT")))*(double)(Double.parseDouble(_s8.GetString("CAT_GP_CONVERSION3")))));
RDebugUtils.currentLine=851988;
 //BA.debugLineNum = 851988;BA.debugLine="Dim totalpaquete As Int = 0";
_totalpaquete = (int) (0);
RDebugUtils.currentLine=851990;
 //BA.debugLineNum = 851990;BA.debugLine="totalpaquete = totalpaquete +(totalstick/200)";
_totalpaquete = (int) (_totalpaquete+(_totalstick/(double)200));
RDebugUtils.currentLine=851991;
 //BA.debugLineNum = 851991;BA.debugLine="Log(totalpaquete)";
anywheresoftware.b4a.keywords.Common.LogImpl("0851991",BA.NumberToString(_totalpaquete),0);
 }
};
 };
RDebugUtils.currentLine=851997;
 //BA.debugLineNum = 851997;BA.debugLine="cmd.Parameters = Array As Object(NumberFormat2(B4";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(anywheresoftware.b4a.keywords.Common.NumberFormat2((double)(Double.parseDouble(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (processBA)._montoactual /*String*/ )),(int) (0),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False)),(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (processBA)._clientestotal /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (processBA)._clientesventa /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (processBA)._clientesvisitados /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (processBA)._lat_gps /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (processBA)._lon_gps /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (processBA)._batt /*int*/ ),(Object)(0),(Object)(_totalpaquete),(Object)(_totalstick),(Object)(_encuesta),(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (processBA)._almacen /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (processBA)._rutapreventa /*String*/ )};
RDebugUtils.currentLine=851999;
 //BA.debugLineNum = 851999;BA.debugLine="reqManager.ExecuteCommand(cmd, \"actualizaUltimaGP";
_reqmanager._executecommand /*String*/ (null,_cmd,(Object)("actualizaUltimaGPS"));
RDebugUtils.currentLine=852000;
 //BA.debugLineNum = 852000;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=852002;
 //BA.debugLineNum = 852002;BA.debugLine="Timer1.Enabled = False";
_timer1.setEnabled(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=852003;
 //BA.debugLineNum = 852003;BA.debugLine="Timer1.Interval = Interval * 1000";
_timer1.setInterval((long) (_interval*1000));
RDebugUtils.currentLine=852004;
 //BA.debugLineNum = 852004;BA.debugLine="Timer1.Enabled = True";
_timer1.setEnabled(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=852005;
 //BA.debugLineNum = 852005;BA.debugLine="End Sub";
return "";
}
public static String  _gps_locationchanged(anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
RDebugUtils.currentModule="starter";
if (Debug.shouldDelegate(processBA, "gps_locationchanged", false))
	 {return ((String) Debug.delegate(processBA, "gps_locationchanged", new Object[] {_location1}));}
RDebugUtils.currentLine=655360;
 //BA.debugLineNum = 655360;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
RDebugUtils.currentLine=655362;
 //BA.debugLineNum = 655362;BA.debugLine="End Sub";
return "";
}
public static String  _jobdone(gunav2.keymon.com.mx.httpjob _job) throws Exception{
RDebugUtils.currentModule="starter";
if (Debug.shouldDelegate(processBA, "jobdone", false))
	 {return ((String) Debug.delegate(processBA, "jobdone", new Object[] {_job}));}
gunav2.keymon.com.mx.dbrequestmanager._dbresult _result = null;
RDebugUtils.currentLine=1048576;
 //BA.debugLineNum = 1048576;BA.debugLine="Sub JobDone(Job As HttpJob)";
RDebugUtils.currentLine=1048577;
 //BA.debugLineNum = 1048577;BA.debugLine="Log(\"JOBDONE STARTER\")";
anywheresoftware.b4a.keywords.Common.LogImpl("01048577","JOBDONE STARTER",0);
RDebugUtils.currentLine=1048579;
 //BA.debugLineNum = 1048579;BA.debugLine="If Job.Success = False Then ' Si hay unerror en e";
if (_job._success /*boolean*/ ==anywheresoftware.b4a.keywords.Common.False) { 
RDebugUtils.currentLine=1048581;
 //BA.debugLineNum = 1048581;BA.debugLine="LogColor(\"Error: \" & Job.ErrorMessage, Colors.re";
anywheresoftware.b4a.keywords.Common.LogImpl("01048581","Error: "+_job._errormessage /*String*/ ,anywheresoftware.b4a.keywords.Common.Colors.Red);
 }else {
RDebugUtils.currentLine=1048583;
 //BA.debugLineNum = 1048583;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
RDebugUtils.currentLine=1048584;
 //BA.debugLineNum = 1048584;BA.debugLine="Dim RESULT As DBResult = B4XPages.MainPage.reqM";
_result = mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (processBA)._reqmanager /*gunav2.keymon.com.mx.dbrequestmanager*/ ._handlejob /*gunav2.keymon.com.mx.dbrequestmanager._dbresult*/ (null,_job);
RDebugUtils.currentLine=1048585;
 //BA.debugLineNum = 1048585;BA.debugLine="Log($\"Tag: ${RESULT.tag}, success=${Job.Success";
anywheresoftware.b4a.keywords.Common.LogImpl("01048585",("Tag: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",_result.Tag /*Object*/ )+", success="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_job._success /*boolean*/ ))+""),0);
 };
 };
RDebugUtils.currentLine=1048589;
 //BA.debugLineNum = 1048589;BA.debugLine="End Sub";
return "";
}
public static String  _logcat_logcatdata(byte[] _buffer,int _length) throws Exception{
RDebugUtils.currentModule="starter";
if (Debug.shouldDelegate(processBA, "logcat_logcatdata", false))
	 {return ((String) Debug.delegate(processBA, "logcat_logcatdata", new Object[] {_buffer,_length}));}
RDebugUtils.currentLine=917504;
 //BA.debugLineNum = 917504;BA.debugLine="Private Sub logcat_LogCatData (Buffer() As Byte, L";
RDebugUtils.currentLine=917505;
 //BA.debugLineNum = 917505;BA.debugLine="logs.Append(BytesToString(Buffer, 0, Length, \"utf";
_logs.Append(anywheresoftware.b4a.keywords.Common.BytesToString(_buffer,(int) (0),_length,"utf8"));
RDebugUtils.currentLine=917506;
 //BA.debugLineNum = 917506;BA.debugLine="If logs.Length > 4000 Then";
if (_logs.getLength()>4000) { 
RDebugUtils.currentLine=917507;
 //BA.debugLineNum = 917507;BA.debugLine="logs.Remove(0, logs.Length - 2000) 'Obtenemos lo";
_logs.Remove((int) (0),(int) (_logs.getLength()-2000));
 };
RDebugUtils.currentLine=917509;
 //BA.debugLineNum = 917509;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=393216;
 //BA.debugLineNum = 393216;BA.debugLine="Sub Service_Create";
RDebugUtils.currentLine=393219;
 //BA.debugLineNum = 393219;BA.debugLine="gps.Initialize(\"GPS\")";
_gps.Initialize("GPS");
RDebugUtils.currentLine=393220;
 //BA.debugLineNum = 393220;BA.debugLine="CallSubDelayed(FirebaseMessaging, \"SubscribeToTop";
anywheresoftware.b4a.keywords.Common.CallSubDelayed(processBA,(Object)(mostCurrent._firebasemessaging.getObject()),"SubscribeToTopics");
RDebugUtils.currentLine=393221;
 //BA.debugLineNum = 393221;BA.debugLine="BTAdmin.Initialize(\"admin\")";
_btadmin.Initialize(processBA,"admin");
RDebugUtils.currentLine=393222;
 //BA.debugLineNum = 393222;BA.debugLine="Timer1.Initialize(\"Timer1\", Interval * 1000)";
_timer1.Initialize(processBA,"Timer1",(long) (_interval*1000));
RDebugUtils.currentLine=393223;
 //BA.debugLineNum = 393223;BA.debugLine="Timer1.Enabled = True";
_timer1.setEnabled(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=393228;
 //BA.debugLineNum = 393228;BA.debugLine="logs.Initialize";
_logs.Initialize();
RDebugUtils.currentLine=393229;
 //BA.debugLineNum = 393229;BA.debugLine="fFileProvider.Initialize";
_ffileprovider._initialize /*String*/ (null,processBA);
RDebugUtils.currentLine=393230;
 //BA.debugLineNum = 393230;BA.debugLine="CallSubDelayed(FirebaseMessaging, \"SubscribeToTop";
anywheresoftware.b4a.keywords.Common.CallSubDelayed(processBA,(Object)(mostCurrent._firebasemessaging.getObject()),"SubscribeToTopics");
RDebugUtils.currentLine=393231;
 //BA.debugLineNum = 393231;BA.debugLine="ubicacionActual.Initialize";
_ubicacionactual.Initialize();
RDebugUtils.currentLine=393232;
 //BA.debugLineNum = 393232;BA.debugLine="If File.Exists(File.DirInternal, \"kmt.db\") = Fals";
if (anywheresoftware.b4a.keywords.Common.File.Exists(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"kmt.db")==anywheresoftware.b4a.keywords.Common.False) { 
RDebugUtils.currentLine=393233;
 //BA.debugLineNum = 393233;BA.debugLine="File.Copy(File.DirAssets, \"kmt.db\", File.DirInte";
anywheresoftware.b4a.keywords.Common.File.Copy(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"kmt.db",anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"kmt.db");
 };
RDebugUtils.currentLine=393235;
 //BA.debugLineNum = 393235;BA.debugLine="skmt.Initialize(File.DirInternal,\"kmt.db\", True)";
_skmt.Initialize(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"kmt.db",anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=393236;
 //BA.debugLineNum = 393236;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=786432;
 //BA.debugLineNum = 786432;BA.debugLine="Sub Service_Destroy";
RDebugUtils.currentLine=786434;
 //BA.debugLineNum = 786434;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}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _s = null;
RDebugUtils.currentLine=524288;
 //BA.debugLineNum = 524288;BA.debugLine="Sub Service_Start (StartingIntent As Intent)";
RDebugUtils.currentLine=524289;
 //BA.debugLineNum = 524289;BA.debugLine="Service.StopAutomaticForeground 'Starter service";
mostCurrent._service.StopAutomaticForeground();
RDebugUtils.currentLine=524290;
 //BA.debugLineNum = 524290;BA.debugLine="Subs.revisaBD";
mostCurrent._subs._revisabd /*String*/ (processBA);
RDebugUtils.currentLine=524291;
 //BA.debugLineNum = 524291;BA.debugLine="Log(marcaCel)";
anywheresoftware.b4a.keywords.Common.LogImpl("0524291",_marcacel,0);
RDebugUtils.currentLine=524292;
 //BA.debugLineNum = 524292;BA.debugLine="Private s As Cursor = skmt.ExecQuery(\"select * fr";
_s = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery("select * from cat_variables where cat_va_descripcion = 'DBReqServer'")));
RDebugUtils.currentLine=524293;
 //BA.debugLineNum = 524293;BA.debugLine="If s.RowCount > 0 Then 'Si tenemso valor en BD lo";
if (_s.getRowCount()>0) { 
RDebugUtils.currentLine=524294;
 //BA.debugLineNum = 524294;BA.debugLine="s.Position = 0";
_s.setPosition((int) (0));
RDebugUtils.currentLine=524295;
 //BA.debugLineNum = 524295;BA.debugLine="server = s.GetString(\"CAT_VA_VALOR\")";
_server = _s.GetString("CAT_VA_VALOR");
 }else {
RDebugUtils.currentLine=524297;
 //BA.debugLineNum = 524297;BA.debugLine="skmt.ExecNonQuery2(\"delete from CAT_VARIABLES wh";
_skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("DBReqServer")}));
RDebugUtils.currentLine=524298;
 //BA.debugLineNum = 524298;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO CAT_VARIABLES(CA";
_skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("DBReqServer"),(Object)(_server)}));
 };
RDebugUtils.currentLine=524300;
 //BA.debugLineNum = 524300;BA.debugLine="reqManager.Initialize(Me, server)";
_reqmanager._initialize /*String*/ (null,processBA,starter.getObject(),_server);
RDebugUtils.currentLine=524301;
 //BA.debugLineNum = 524301;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=720896;
 //BA.debugLineNum = 720896;BA.debugLine="Sub Service_TaskRemoved";
RDebugUtils.currentLine=720898;
 //BA.debugLineNum = 720898;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=589824;
 //BA.debugLineNum = 589824;BA.debugLine="Private Sub Timer1_Tick";
RDebugUtils.currentLine=589826;
 //BA.debugLineNum = 589826;BA.debugLine="ENVIA_ULTIMA_GPS";
_envia_ultima_gps();
RDebugUtils.currentLine=589827;
 //BA.debugLineNum = 589827;BA.debugLine="End Sub";
return "";
}
}