package medicomed.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, BA.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 BA(this, null, null, "medicomed.keymon.com.mx", "medicomed.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, "medicomed.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");
    		}
    	}
    }

	public void onTimeout(int startId) {
        BA.LogInfo("** Service (starter) Timeout **");
        anywheresoftware.b4a.objects.collections.Map params = new anywheresoftware.b4a.objects.collections.Map();
        params.Initialize();
        params.Put("StartId", startId);
        processBA.raiseEvent(null, "service_timeout", params);
            
    }
	@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.sql.SQL _skmt = null;
public static medicomed.keymon.com.mx.c_subs _s = null;
public static anywheresoftware.b4a.phone.Phone _ph = null;
public static anywheresoftware.b4a.objects.RuntimePermissions _rp = null;
public static uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper _flp = null;
public static medicomed.keymon.com.mx.dbrequestmanager _reqmanager = null;
public static String _dbreqserver = "";
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 String _muestraprogreso = "";
public static boolean _logger = false;
public static String _mac_impresora = "";
public static String _marcacel = "";
public static String _tabla = "";
public static float _pre_viejo = 0f;
public static anywheresoftware.b4a.objects.Serial.BluetoothAdmin _btadmin = null;
public static boolean _bluetoothstate = false;
public static boolean _enventa = false;
public static String _banderaactualizar = "";
public static String _imei_base = "";
public b4a.example.dateutils _dateutils = null;
public medicomed.keymon.com.mx.main _main = null;
public medicomed.keymon.com.mx.appupdater _appupdater = null;
public medicomed.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public medicomed.keymon.com.mx.mapa_cliente _mapa_cliente = null;
public medicomed.keymon.com.mx.subs _subs = null;
public medicomed.keymon.com.mx.notificationservice _notificationservice = null;
public medicomed.keymon.com.mx.pendientes _pendientes = null;
public medicomed.keymon.com.mx.tracker _tracker = null;
public medicomed.keymon.com.mx.newinst2 _newinst2 = null;
public medicomed.keymon.com.mx.b4xpages _b4xpages = null;
public medicomed.keymon.com.mx.b4xcollections _b4xcollections = null;
public medicomed.keymon.com.mx.httputils2service _httputils2service = null;
public medicomed.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public static boolean  _application_error(anywheresoftware.b4a.objects.B4AException _error,String _stacktrace) throws Exception{
anywheresoftware.b4j.object.JavaObject _jo = null;
long _l = 0L;
 //BA.debugLineNum = 120;BA.debugLine="Sub Application_Error (Error As Exception, StackTr";
 //BA.debugLineNum = 122;BA.debugLine="Dim jo As JavaObject";
_jo = new anywheresoftware.b4j.object.JavaObject();
 //BA.debugLineNum = 123;BA.debugLine="Dim l As Long = 500: jo.InitializeStatic(\"java.la";
_l = (long) (500);
 //BA.debugLineNum = 123;BA.debugLine="Dim l As Long = 500: jo.InitializeStatic(\"java.la";
_jo.InitializeStatic("java.lang.Thread").RunMethod("sleep",new Object[]{(Object)(_l)});
 //BA.debugLineNum = 124;BA.debugLine="logcat.LogCatStop";
_logcat.LogCatStop();
 //BA.debugLineNum = 125;BA.debugLine="logs.Append(StackTrace)";
_logs.Append(_stacktrace);
 //BA.debugLineNum = 126;BA.debugLine="Subs.revisaBD";
mostCurrent._subs._revisabd /*String*/ (processBA);
 //BA.debugLineNum = 127;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())}));
 //BA.debugLineNum = 128;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
 //BA.debugLineNum = 129;BA.debugLine="End Sub";
return false;
}
public static String  _btadmin_statechanged(int _newstate,int _oldstate) throws Exception{
 //BA.debugLineNum = 58;BA.debugLine="Private Sub BTAdmin_StateChanged (NewState As Int,";
 //BA.debugLineNum = 59;BA.debugLine="If logger Then Log(\"BT state changed: \" & NewStat";
if (_logger) { 
anywheresoftware.b4a.keywords.Common.LogImpl("7458753","BT state changed: "+BA.NumberToString(_newstate),0);};
 //BA.debugLineNum = 60;BA.debugLine="BluetoothState = NewState = BTAdmin.STATE_ON";
_bluetoothstate = _newstate==_btadmin.STATE_ON;
 //BA.debugLineNum = 62;BA.debugLine="End Sub";
return "";
}
public static String  _envia_ultima_gps() throws Exception{
medicomed.keymon.com.mx.dbrequestmanager._dbcommand _cmd = null;
 //BA.debugLineNum = 90;BA.debugLine="Sub ENVIA_ULTIMA_GPS";
 //BA.debugLineNum = 91;BA.debugLine="Dim logger As Boolean = False";
_logger = anywheresoftware.b4a.keywords.Common.False;
 //BA.debugLineNum = 92;BA.debugLine="If logger Then LogColor(\"Iniciamos ENVIA_ULTIMA_G";
if (_logger) { 
anywheresoftware.b4a.keywords.Common.LogImpl("7851970","Iniciamos ENVIA_ULTIMA_GPS",anywheresoftware.b4a.keywords.Common.Colors.Magenta);};
 //BA.debugLineNum = 93;BA.debugLine="Dim cmd As DBCommand";
_cmd = new medicomed.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 97;BA.debugLine="Dim cmd As DBCommand";
_cmd = new medicomed.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 98;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 99;BA.debugLine="cmd.Name = \"UPDATE_MEDI_ACTUAL2_GPS_V2\"";
_cmd.Name /*String*/  = "UPDATE_MEDI_ACTUAL2_GPS_V2";
 //BA.debugLineNum = 100;BA.debugLine="If B4XPages.MainPage.lat_gps.Length < 15 Then B4X";
if (mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._lat_gps /*String*/ .length()<15) { 
mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._lat_gps /*String*/  = mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._lat_gps /*String*/ +"0";};
 //BA.debugLineNum = 101;BA.debugLine="cmd.Parameters = Array As Object(B4XPages.MainPag";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._montoactual /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._clientestotal /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._clientesventa /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._clientesvisitados /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._lat_gps /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._lon_gps /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._batt /*int*/ ),(Object)(0),(Object)(0),(Object)(0),(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._almacen /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._rutapreventa /*String*/ )};
 //BA.debugLineNum = 102;BA.debugLine="If logger Then Log($\"montoActual: ${B4XPages.Main";
if (_logger) { 
anywheresoftware.b4a.keywords.Common.LogImpl("7851980",("montoActual: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._montoactual /*String*/ ))+", cTotal: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._clientestotal /*String*/ ))+", cVenta: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._clientesventa /*String*/ ))+", cVisitados: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._clientesvisitados /*String*/ ))+", "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._lat_gps /*String*/ ))+", "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._lon_gps /*String*/ ))+", Batt: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._batt /*int*/ ))+", 0, 0, 0, Almacen: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._almacen /*String*/ ))+", Ruta: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (processBA)._rutapreventa /*String*/ ))+""),0);};
 //BA.debugLineNum = 103;BA.debugLine="reqManager.ExecuteCommand(cmd, \"inst_visitas\")";
_reqmanager._executecommand /*String*/ (_cmd,(Object)("inst_visitas"));
 //BA.debugLineNum = 104;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"}));
 //BA.debugLineNum = 106;BA.debugLine="Timer1.Enabled = False";
_timer1.setEnabled(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 107;BA.debugLine="Timer1.Interval = Interval * 1000";
_timer1.setInterval((long) (_interval*1000));
 //BA.debugLineNum = 108;BA.debugLine="Timer1.Enabled = True";
_timer1.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 109;BA.debugLine="End Sub";
return "";
}
public static String  _gps_locationchanged(anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
 //BA.debugLineNum = 78;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
 //BA.debugLineNum = 80;BA.debugLine="End Sub";
return "";
}
public static String  _logcat_logcatdata(byte[] _buffer,int _length) throws Exception{
 //BA.debugLineNum = 112;BA.debugLine="Private Sub logcat_LogCatData (Buffer() As Byte, L";
 //BA.debugLineNum = 113;BA.debugLine="logs.Append(BytesToString(Buffer, 0, Length, \"utf";
_logs.Append(anywheresoftware.b4a.keywords.Common.BytesToString(_buffer,(int) (0),_length,"utf8"));
 //BA.debugLineNum = 114;BA.debugLine="If logs.Length > 4000 Then";
if (_logs.getLength()>4000) { 
 //BA.debugLineNum = 115;BA.debugLine="logs.Remove(0, logs.Length - 2000) 'Obtenemos lo";
_logs.Remove((int) (0),(int) (_logs.getLength()-2000));
 };
 //BA.debugLineNum = 117;BA.debugLine="End Sub";
return "";
}
public static String  _process_globals() throws Exception{
 //BA.debugLineNum = 6;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 9;BA.debugLine="Public gps As GPS";
_gps = new anywheresoftware.b4a.gps.GPS();
 //BA.debugLineNum = 10;BA.debugLine="Dim skmt As SQL";
_skmt = new anywheresoftware.b4a.sql.SQL();
 //BA.debugLineNum = 11;BA.debugLine="Dim s As C_Subs";
_s = new medicomed.keymon.com.mx.c_subs();
 //BA.debugLineNum = 12;BA.debugLine="Dim ph As Phone";
_ph = new anywheresoftware.b4a.phone.Phone();
 //BA.debugLineNum = 13;BA.debugLine="Public rp As RuntimePermissions";
_rp = new anywheresoftware.b4a.objects.RuntimePermissions();
 //BA.debugLineNum = 14;BA.debugLine="Public FLP As FusedLocationProvider";
_flp = new uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper();
 //BA.debugLineNum = 16;BA.debugLine="Dim reqManager As DBRequestManager";
_reqmanager = new medicomed.keymon.com.mx.dbrequestmanager();
 //BA.debugLineNum = 17;BA.debugLine="Dim DBReqServer As String = \"http://187.189.244.1";
_dbreqserver = "http://187.189.244.154:1781";
 //BA.debugLineNum = 21;BA.debugLine="Dim Timer1 As Timer";
_timer1 = new anywheresoftware.b4a.objects.Timer();
 //BA.debugLineNum = 22;BA.debugLine="Dim Interval As Int = 10";
_interval = (int) (10);
 //BA.debugLineNum = 23;BA.debugLine="Dim ruta As String = File.DirInternal";
_ruta = anywheresoftware.b4a.keywords.Common.File.getDirInternal();
 //BA.debugLineNum = 25;BA.debugLine="Private logs As StringBuilder";
_logs = new anywheresoftware.b4a.keywords.StringBuilderWrapper();
 //BA.debugLineNum = 26;BA.debugLine="Private logcat As LogCat";
_logcat = new anywheresoftware.b4a.phone.Phone.LogCat();
 //BA.debugLineNum = 27;BA.debugLine="Dim muestraProgreso = 0";
_muestraprogreso = BA.NumberToString(0);
 //BA.debugLineNum = 28;BA.debugLine="Dim logger As Boolean = False";
_logger = anywheresoftware.b4a.keywords.Common.False;
 //BA.debugLineNum = 29;BA.debugLine="Dim MAC_IMPRESORA As String";
_mac_impresora = "";
 //BA.debugLineNum = 30;BA.debugLine="Dim marcaCel As String = ph.manufacturer";
_marcacel = _ph.getManufacturer();
 //BA.debugLineNum = 31;BA.debugLine="Dim tabla As String";
_tabla = "";
 //BA.debugLineNum = 32;BA.debugLine="Dim pre_viejo As Float";
_pre_viejo = 0f;
 //BA.debugLineNum = 33;BA.debugLine="Private BTAdmin As BluetoothAdmin";
_btadmin = new anywheresoftware.b4a.objects.Serial.BluetoothAdmin();
 //BA.debugLineNum = 34;BA.debugLine="Public BluetoothState As Boolean";
_bluetoothstate = false;
 //BA.debugLineNum = 35;BA.debugLine="Dim enVenta As Boolean = False";
_enventa = anywheresoftware.b4a.keywords.Common.False;
 //BA.debugLineNum = 36;BA.debugLine="Dim BanderaActualizar As String = \"0\"";
_banderaactualizar = "0";
 //BA.debugLineNum = 37;BA.debugLine="Public IMEI_BASE As String";
_imei_base = "";
 //BA.debugLineNum = 38;BA.debugLine="End Sub";
return "";
}
public static String  _reinicializareqmanager(String _srv) throws Exception{
 //BA.debugLineNum = 132;BA.debugLine="Sub reinicializaReqManager(srv As String)";
 //BA.debugLineNum = 133;BA.debugLine="skmt.ExecNonQuery2(\"delete from CAT_VARIABLES whe";
_skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("SERVER")}));
 //BA.debugLineNum = 134;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO CAT_VARIABLES(CAT";
_skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("SERVER"),(Object)(_srv)}));
 //BA.debugLineNum = 135;BA.debugLine="DBReqServer = srv";
_dbreqserver = _srv;
 //BA.debugLineNum = 136;BA.debugLine="reqManager.Initialize(Me, srv)";
_reqmanager._initialize /*String*/ (processBA,starter.getObject(),_srv);
 //BA.debugLineNum = 137;BA.debugLine="LogColor(srv, Colors.red)";
anywheresoftware.b4a.keywords.Common.LogImpl("71048581",_srv,anywheresoftware.b4a.keywords.Common.Colors.Red);
 //BA.debugLineNum = 138;BA.debugLine="End Sub";
return "";
}
public static String  _service_create() throws Exception{
 //BA.debugLineNum = 40;BA.debugLine="Sub Service_Create";
 //BA.debugLineNum = 43;BA.debugLine="gps.Initialize(\"GPS\")";
_gps.Initialize("GPS");
 //BA.debugLineNum = 44;BA.debugLine="s.Initialize(Me, \"Subs\") 'Inicializamos la clase";
_s._initialize /*Object*/ (processBA,starter.getObject(),"Subs");
 //BA.debugLineNum = 45;BA.debugLine="skmt = s.inicializaBD(File.DirInternal, \"kmt.db\")";
_skmt = _s._inicializabd /*anywheresoftware.b4a.sql.SQL*/ (anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"kmt.db");
 //BA.debugLineNum = 46;BA.debugLine="BTAdmin.Initialize(\"admin\")";
_btadmin.Initialize(processBA,"admin");
 //BA.debugLineNum = 48;BA.debugLine="Timer1.Initialize(\"Timer1\", Interval * 1000)";
_timer1.Initialize(processBA,"Timer1",(long) (_interval*1000));
 //BA.debugLineNum = 49;BA.debugLine="Timer1.Enabled = True";
_timer1.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 52;BA.debugLine="logcat.LogCatStart(Array As String(\"-v\",\"raw\",\"*:";
_logcat.LogCatStart(processBA,new String[]{"-v","raw","*:F","B4A:v"},"logcat");
 //BA.debugLineNum = 54;BA.debugLine="logs.Initialize";
_logs.Initialize();
 //BA.debugLineNum = 56;BA.debugLine="End Sub";
return "";
}
public static String  _service_destroy() throws Exception{
 //BA.debugLineNum = 86;BA.debugLine="Sub Service_Destroy";
 //BA.debugLineNum = 88;BA.debugLine="End Sub";
return "";
}
public static String  _service_start(anywheresoftware.b4a.objects.IntentWrapper _startingintent) throws Exception{
 //BA.debugLineNum = 64;BA.debugLine="Sub Service_Start (StartingIntent As Intent)";
 //BA.debugLineNum = 65;BA.debugLine="Service.StopAutomaticForeground 'Starter service";
mostCurrent._service.StopAutomaticForeground();
 //BA.debugLineNum = 66;BA.debugLine="Subs.revisaBD";
mostCurrent._subs._revisabd /*String*/ (processBA);
 //BA.debugLineNum = 68;BA.debugLine="If s.traeDBReqServerDeBD(skmt) <> \"N/A\" And s.tra";
if ((_s._traedbreqserverdebd /*String*/ (_skmt)).equals("N/A") == false && (_s._traedbreqserverdebd /*String*/ (_skmt)).equals("") == false) { 
_dbreqserver = _s._traedbreqserverdebd /*String*/ (_skmt);};
 //BA.debugLineNum = 69;BA.debugLine="reqManager.Initialize(Me, DBReqServer)";
_reqmanager._initialize /*String*/ (processBA,starter.getObject(),_dbreqserver);
 //BA.debugLineNum = 70;BA.debugLine="Log($\"Starter - |${DBReqServer}|\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("7524294",("Starter - |"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_dbreqserver))+"|"),0);
 //BA.debugLineNum = 71;BA.debugLine="End Sub";
return "";
}
public static String  _service_taskremoved() throws Exception{
 //BA.debugLineNum = 82;BA.debugLine="Sub Service_TaskRemoved";
 //BA.debugLineNum = 84;BA.debugLine="End Sub";
return "";
}
public static String  _timer1_tick() throws Exception{
 //BA.debugLineNum = 73;BA.debugLine="Private Sub Timer1_Tick";
 //BA.debugLineNum = 75;BA.debugLine="ENVIA_ULTIMA_GPS";
_envia_ultima_gps();
 //BA.debugLineNum = 76;BA.debugLine="End Sub";
return "";
}
}
