package keymon.lat.medicomed;


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

public class tracker extends android.app.Service{
	public static class tracker_BR extends android.content.BroadcastReceiver {

		@Override
		public void onReceive(android.content.Context context, android.content.Intent intent) {
            BA.LogInfo("** Receiver (tracker) OnReceive **");
			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);
		}

	}
    static tracker mostCurrent;
	public static BA processBA;
    private ServiceHelper _service;
    public static Class<?> getObject() {
		return tracker.class;
	}
	@Override
	public void onCreate() {
        super.onCreate();
        mostCurrent = this;
        if (processBA == null) {
		    processBA = new anywheresoftware.b4a.ShellBA(this, null, null, "keymon.lat.medicomed", "keymon.lat.medicomed.tracker");
            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, "keymon.lat.medicomed.tracker", processBA, _service, anywheresoftware.b4a.keywords.Common.Density);
		}
        if (!false && ServiceHelper.StarterHelper.startFromServiceCreate(processBA, false) == false) {
				
		}
		else {
            processBA.setActivityPaused(false);
            BA.LogInfo("*** Service (tracker) Create ***");
            processBA.raiseEvent(null, "service_create");
        }
        processBA.runHook("oncreate", this, null);
        if (false) {
			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 (tracker) 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 (false)
            processBA.raiseEvent(null, "service_taskremoved");
            
    }
    private void handleStart(android.content.Intent intent) {
    	BA.LogInfo("** Service (tracker) 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 (false) {
            BA.LogInfo("** Service (tracker) Destroy (ignored)**");
        }
        else {
            BA.LogInfo("** Service (tracker) 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 int _nid = 0;
public static boolean _tracking = false;
public static anywheresoftware.b4a.phone.Phone.PhoneWakeState _lock = null;
public static uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper _flp = null;
public static uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest _actuallr = null;
public static boolean _flpstarted = false;
public static anywheresoftware.b4a.gps.LocationWrapper _uugcoords = null;
public b4a.example.dateutils _dateutils = null;
public keymon.lat.medicomed.main _main = null;
public keymon.lat.medicomed.starter _starter = null;
public keymon.lat.medicomed.subs _subs = null;
public keymon.lat.medicomed.appupdater _appupdater = null;
public keymon.lat.medicomed.mapa_rutas _mapa_rutas = null;
public keymon.lat.medicomed.newinst2 _newinst2 = null;
public keymon.lat.medicomed.b4xpages _b4xpages = null;
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";
_lr = new uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest();
RDebugUtils.currentLine=29556739;
 //BA.debugLineNum = 29556739;BA.debugLine="lr.Initialize";
_lr.Initialize();
RDebugUtils.currentLine=29556740;
 //BA.debugLineNum = 29556740;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";
_lr.SetFastestInterval((long) (_lr.GetInterval()/(double)2));
RDebugUtils.currentLine=29556742;
 //BA.debugLineNum = 29556742;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";
_lr.SetPriority(_lr.Priority.PRIORITY_HIGH_ACCURACY);
RDebugUtils.currentLine=29556744;
 //BA.debugLineNum = 29556744;BA.debugLine="actualLR=lr";
_actuallr = _lr;
RDebugUtils.currentLine=29556745;
 //BA.debugLineNum = 29556745;BA.debugLine="Return lr";
if (true) return _lr;
RDebugUtils.currentLine=29556746;
 //BA.debugLineNum = 29556746;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";
_lr = new uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest();
RDebugUtils.currentLine=29622275;
 //BA.debugLineNum = 29622275;BA.debugLine="lr.Initialize";
_lr.Initialize();
RDebugUtils.currentLine=29622276;
 //BA.debugLineNum = 29622276;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";
_lr.SetFastestInterval((long) (_lr.GetInterval()/(double)2));
RDebugUtils.currentLine=29622278;
 //BA.debugLineNum = 29622278;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";
_lr.SetSmallestDisplacement((float) (0));
RDebugUtils.currentLine=29622280;
 //BA.debugLineNum = 29622280;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";
_actuallr = _lr;
RDebugUtils.currentLine=29622282;
 //BA.debugLineNum = 29622282;BA.debugLine="Return lr";
if (true) return _lr;
RDebugUtils.currentLine=29622283;
 //BA.debugLineNum = 29622283;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";
_notification = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=29884418;
 //BA.debugLineNum = 29884418;BA.debugLine="notification.Initialize2(notification.IMPORTANCE_";
_notification.Initialize2(_notification.IMPORTANCE_LOW);
RDebugUtils.currentLine=29884419;
 //BA.debugLineNum = 29884419;BA.debugLine="notification.Icon = \"icon\"";
_notification.setIcon("icon");
RDebugUtils.currentLine=29884420;
 //BA.debugLineNum = 29884420;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";
if (true) return _notification;
RDebugUtils.currentLine=29884422;
 //BA.debugLineNum = 29884422;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";
if (_flp.GetLastKnownLocation().IsInitialized()) { 
RDebugUtils.currentLine=29687811;
 //BA.debugLineNum = 29687811;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.";
_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";
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";
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";
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";
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";
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";
_uugcoords = _location1;
RDebugUtils.currentLine=29818893;
 //BA.debugLineNum = 29818893;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
RDebugUtils.currentLine=29818894;
 //BA.debugLineNum = 29818894;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)";
_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)";
_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";
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";
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";
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);
 };
RDebugUtils.currentLine=29818905;
 //BA.debugLineNum = 29818905;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";
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";
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";
_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";
if (anywheresoftware.b4a.keywords.Common.Not(_flp.IsInitialized())) { 
RDebugUtils.currentLine=30081029;
 //BA.debugLineNum = 30081029;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\")";
_flp.Initialize(processBA,"flp");
RDebugUtils.currentLine=30081031;
 //BA.debugLineNum = 30081031;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);
 };
RDebugUtils.currentLine=30081036;
 //BA.debugLineNum = 30081036;BA.debugLine="Try";
try {RDebugUtils.currentLine=30081037;
 //BA.debugLineNum = 30081037;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";
if (anywheresoftware.b4a.keywords.Common.Not(_flp.IsConnected())) { 
RDebugUtils.currentLine=30081040;
 //BA.debugLineNum = 30081040;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";
_startflp();
RDebugUtils.currentLine=30081043;
 //BA.debugLineNum = 30081043;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);
 };
RDebugUtils.currentLine=30081048;
 //BA.debugLineNum = 30081048;BA.debugLine="Try";
try {RDebugUtils.currentLine=30081049;
 //BA.debugLineNum = 30081049;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";
mostCurrent._subs._log2db /*String*/ (processBA,"revisaFLP: 'No se esta actualizando, lo reiniciamos ...'");
RDebugUtils.currentLine=30081053;
 //BA.debugLineNum = 30081053;BA.debugLine="StartService(Me)";
anywheresoftware.b4a.keywords.Common.StartService(processBA,tracker.getObject());
RDebugUtils.currentLine=30081054;
 //BA.debugLineNum = 30081054;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);
 };
 };
RDebugUtils.currentLine=30081060;
 //BA.debugLineNum = 30081060;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);};
 } 
       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);
 };
RDebugUtils.currentLine=30081065;
 //BA.debugLineNum = 30081065;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);
}
public static class ResumableSub_StartFLP extends BA.ResumableSub {
public ResumableSub_StartFLP(keymon.lat.medicomed.tracker parent) {
this.parent = parent;
}
keymon.lat.medicomed.tracker parent;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="tracker";

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=29425666;
 //BA.debugLineNum = 29425666;BA.debugLine="Do While FLP.IsConnected = False";
if (true) break;

case 1:
//do while
this.state = 4;
while (parent._flp.IsConnected()==anywheresoftware.b4a.keywords.Common.False) {
this.state = 3;
if (true) break;
}
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));
this.state = 5;
return;
case 5:
//C
this.state = 1;
;
 if (true) break;

case 4:
//C
this.state = -1;
;
RDebugUtils.currentLine=29425672;
 //BA.debugLineNum = 29425672;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";
parent._flpstarted = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=29425677;
 //BA.debugLineNum = 29425677;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);
}
public static class ResumableSub_StartFLPSmall extends BA.ResumableSub {
public ResumableSub_StartFLPSmall(keymon.lat.medicomed.tracker parent) {
this.parent = parent;
}
keymon.lat.medicomed.tracker parent;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="tracker";

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=29491202;
 //BA.debugLineNum = 29491202;BA.debugLine="Do While FLP.IsConnected = False";
if (true) break;

case 1:
//do while
this.state = 4;
while (parent._flp.IsConnected()==anywheresoftware.b4a.keywords.Common.False) {
this.state = 3;
if (true) break;
}
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));
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);
 if (true) break;

case 4:
//C
this.state = -1;
;
RDebugUtils.currentLine=29491206;
 //BA.debugLineNum = 29491206;BA.debugLine="dameUltimaUbicacionConocida 'Regresamos ultima ub";
_dameultimaubicacionconocida();
RDebugUtils.currentLine=29491207;
 //BA.debugLineNum = 29491207;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";
if (true) break;

            }
        }
    }
}
}