package SHARK2.keymon.com.mx;


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, "SHARK2.keymon.com.mx", "SHARK2.keymon.com.mx.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, "SHARK2.keymon.com.mx.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 SHARK2.keymon.com.mx.main _main = null;
public SHARK2.keymon.com.mx.appupdater _appupdater = null;
public SHARK2.keymon.com.mx.mapa_cliente _mapa_cliente = null;
public SHARK2.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public SHARK2.keymon.com.mx.notificationservice _notificationservice = null;
public SHARK2.keymon.com.mx.pendientes _pendientes = null;
public SHARK2.keymon.com.mx.starter _starter = null;
public SHARK2.keymon.com.mx.subs _subs = null;
public SHARK2.keymon.com.mx.newinst2 _newinst2 = null;
public SHARK2.keymon.com.mx.b4xpages _b4xpages = null;
public SHARK2.keymon.com.mx.b4xcollections _b4xcollections = null;
public SHARK2.keymon.com.mx.httputils2service _httputils2service = null;
public SHARK2.keymon.com.mx.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=42795008;
 //BA.debugLineNum = 42795008;BA.debugLine="Private Sub CreateLocationRequest As LocationReque";
RDebugUtils.currentLine=42795010;
 //BA.debugLineNum = 42795010;BA.debugLine="Dim lr As LocationRequest";
_lr = new uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest();
RDebugUtils.currentLine=42795011;
 //BA.debugLineNum = 42795011;BA.debugLine="lr.Initialize";
_lr.Initialize();
RDebugUtils.currentLine=42795012;
 //BA.debugLineNum = 42795012;BA.debugLine="lr.SetInterval(10000) 'Intervalo deseado para act";
_lr.SetInterval((long) (10000));
RDebugUtils.currentLine=42795013;
 //BA.debugLineNum = 42795013;BA.debugLine="lr.SetFastestInterval(lr.GetInterval / 2) 'Interv";
_lr.SetFastestInterval((long) (_lr.GetInterval()/(double)2));
RDebugUtils.currentLine=42795014;
 //BA.debugLineNum = 42795014;BA.debugLine="lr.SetSmallestDisplacement(50) 'Solo registra cam";
_lr.SetSmallestDisplacement((float) (50));
RDebugUtils.currentLine=42795015;
 //BA.debugLineNum = 42795015;BA.debugLine="lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY";
_lr.SetPriority(_lr.Priority.PRIORITY_HIGH_ACCURACY);
RDebugUtils.currentLine=42795016;
 //BA.debugLineNum = 42795016;BA.debugLine="actualLR=lr";
_actuallr = _lr;
RDebugUtils.currentLine=42795017;
 //BA.debugLineNum = 42795017;BA.debugLine="Return lr";
if (true) return _lr;
RDebugUtils.currentLine=42795018;
 //BA.debugLineNum = 42795018;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=42860544;
 //BA.debugLineNum = 42860544;BA.debugLine="Private Sub CreateLocationRequestSmallD As Locatio";
RDebugUtils.currentLine=42860546;
 //BA.debugLineNum = 42860546;BA.debugLine="Dim lr As LocationRequest";
_lr = new uk.co.martinpearman.b4a.fusedlocationprovider.LocationRequest();
RDebugUtils.currentLine=42860547;
 //BA.debugLineNum = 42860547;BA.debugLine="lr.Initialize";
_lr.Initialize();
RDebugUtils.currentLine=42860548;
 //BA.debugLineNum = 42860548;BA.debugLine="lr.SetInterval(2000) 'Intervalo deseado para actu";
_lr.SetInterval((long) (2000));
RDebugUtils.currentLine=42860549;
 //BA.debugLineNum = 42860549;BA.debugLine="lr.SetFastestInterval(lr.GetInterval / 2) 'Interv";
_lr.SetFastestInterval((long) (_lr.GetInterval()/(double)2));
RDebugUtils.currentLine=42860550;
 //BA.debugLineNum = 42860550;BA.debugLine="lr.setNumUpdates(2) 'Solicitamos solo 2 actualiza";
_lr.SetNumUpdates((int) (2));
RDebugUtils.currentLine=42860551;
 //BA.debugLineNum = 42860551;BA.debugLine="lr.SetSmallestDisplacement(1) 'Solo registra camb";
_lr.SetSmallestDisplacement((float) (1));
RDebugUtils.currentLine=42860552;
 //BA.debugLineNum = 42860552;BA.debugLine="lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY";
_lr.SetPriority(_lr.Priority.PRIORITY_HIGH_ACCURACY);
RDebugUtils.currentLine=42860553;
 //BA.debugLineNum = 42860553;BA.debugLine="actualLR=lr";
_actuallr = _lr;
RDebugUtils.currentLine=42860554;
 //BA.debugLineNum = 42860554;BA.debugLine="Return lr";
if (true) return _lr;
RDebugUtils.currentLine=42860555;
 //BA.debugLineNum = 42860555;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=43122688;
 //BA.debugLineNum = 43122688;BA.debugLine="Sub CreateNotification (Body As String) As Notific";
RDebugUtils.currentLine=43122689;
 //BA.debugLineNum = 43122689;BA.debugLine="Dim notification As Notification";
_notification = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=43122690;
 //BA.debugLineNum = 43122690;BA.debugLine="notification.Initialize2(notification.IMPORTANCE_";
_notification.Initialize2(_notification.IMPORTANCE_LOW);
RDebugUtils.currentLine=43122691;
 //BA.debugLineNum = 43122691;BA.debugLine="notification.Icon = \"icon\"";
_notification.setIcon("icon");
RDebugUtils.currentLine=43122692;
 //BA.debugLineNum = 43122692;BA.debugLine="notification.SetInfo(\"SHARK2\", Body, Main)";
_notification.SetInfoNew(processBA,BA.ObjectToCharSequence("SHARK2"),BA.ObjectToCharSequence(_body),(Object)(mostCurrent._main.getObject()));
RDebugUtils.currentLine=43122693;
 //BA.debugLineNum = 43122693;BA.debugLine="Return notification";
if (true) return _notification;
RDebugUtils.currentLine=43122694;
 //BA.debugLineNum = 43122694;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=42926080;
 //BA.debugLineNum = 42926080;BA.debugLine="Sub dameUltimaUbicacionConocida";
RDebugUtils.currentLine=42926081;
 //BA.debugLineNum = 42926081;BA.debugLine="If FLP.GetLastKnownLocation.IsInitialized Then 'M";
if (_flp.GetLastKnownLocation().IsInitialized()) { 
RDebugUtils.currentLine=42926083;
 //BA.debugLineNum = 42926083;BA.debugLine="If Starter.Logger Then LogColor($\"Mandamos UUC \"";
if (mostCurrent._starter._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("542926083",("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=42926084;
 //BA.debugLineNum = 42926084;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=42926088;
 //BA.debugLineNum = 42926088;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=43253760;
 //BA.debugLineNum = 43253760;BA.debugLine="Sub formatoFecha(fecha As String) As String 'Convi";
RDebugUtils.currentLine=43253762;
 //BA.debugLineNum = 43253762;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=43253763;
 //BA.debugLineNum = 43253763;BA.debugLine="DateTime.DateFormat=\"yyMMddHHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMddHHmmss");
RDebugUtils.currentLine=43253764;
 //BA.debugLineNum = 43253764;BA.debugLine="Dim lastUpdate As String=DateTime.Date(fecha)";
_lastupdate = anywheresoftware.b4a.keywords.Common.DateTime.Date((long)(Double.parseDouble(_fecha)));
RDebugUtils.currentLine=43253765;
 //BA.debugLineNum = 43253765;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=43253767;
 //BA.debugLineNum = 43253767;BA.debugLine="Return lastUpdate";
if (true) return _lastupdate;
RDebugUtils.currentLine=43253768;
 //BA.debugLineNum = 43253768;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=42467328;
 //BA.debugLineNum = 42467328;BA.debugLine="Sub flp_ConnectionFailed(ConnectionResult1 As Int)";
RDebugUtils.currentLine=42467329;
 //BA.debugLineNum = 42467329;BA.debugLine="Log(\"Failed to connect to location provider\")";
anywheresoftware.b4a.keywords.Common.LogImpl("542467329","Failed to connect to location provider",0);
RDebugUtils.currentLine=42467330;
 //BA.debugLineNum = 42467330;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=42401792;
 //BA.debugLineNum = 42401792;BA.debugLine="Sub flp_ConnectionSuccess";
RDebugUtils.currentLine=42401795;
 //BA.debugLineNum = 42401795;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=43057152;
 //BA.debugLineNum = 43057152;BA.debugLine="Sub flp_LocationChanged (Location1 As Location)";
RDebugUtils.currentLine=43057155;
 //BA.debugLineNum = 43057155;BA.debugLine="B4XPages.MainPage.lat_gps = Location1.Latitude";
mostCurrent._b4xpages._mainpage /*SHARK2.keymon.com.mx.b4xmainpage*/ (processBA)._lat_gps /*String*/  = BA.NumberToString(_location1.getLatitude());
RDebugUtils.currentLine=43057156;
 //BA.debugLineNum = 43057156;BA.debugLine="B4XPages.MainPage.lon_gps = Location1.Longitude";
mostCurrent._b4xpages._mainpage /*SHARK2.keymon.com.mx.b4xmainpage*/ (processBA)._lon_gps /*String*/  = BA.NumberToString(_location1.getLongitude());
RDebugUtils.currentLine=43057157;
 //BA.debugLineNum = 43057157;BA.debugLine="UUGCoords = Location1";
_uugcoords = _location1;
RDebugUtils.currentLine=43057165;
 //BA.debugLineNum = 43057165;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
RDebugUtils.currentLine=43057166;
 //BA.debugLineNum = 43057166;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=43057167;
 //BA.debugLineNum = 43057167;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = anywheresoftware.b4a.keywords.Common.DateTime.Date(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=43057168;
 //BA.debugLineNum = 43057168;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = anywheresoftware.b4a.keywords.Common.DateTime.Time(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=43057169;
 //BA.debugLineNum = 43057169;BA.debugLine="If Not(B4XPages.MainPage.skmt.IsInitialized) Then";
if (anywheresoftware.b4a.keywords.Common.Not(mostCurrent._b4xpages._mainpage /*SHARK2.keymon.com.mx.b4xmainpage*/ (processBA)._skmt /*anywheresoftware.b4a.sql.SQL*/ .IsInitialized())) { 
mostCurrent._b4xpages._mainpage /*SHARK2.keymon.com.mx.b4xmainpage*/ (processBA)._skmt /*anywheresoftware.b4a.sql.SQL*/ .Initialize(mostCurrent._starter._ruta /*String*/ ,"kmt.db",anywheresoftware.b4a.keywords.Common.True);};
RDebugUtils.currentLine=43057170;
 //BA.debugLineNum = 43057170;BA.debugLine="Try";
try {RDebugUtils.currentLine=43057171;
 //BA.debugLineNum = 43057171;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
mostCurrent._b4xpages._mainpage /*SHARK2.keymon.com.mx.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 /*SHARK2.keymon.com.mx.b4xmainpage*/ (processBA)._lat_gps /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*SHARK2.keymon.com.mx.b4xmainpage*/ (processBA)._lon_gps /*String*/ )}));
RDebugUtils.currentLine=43057172;
 //BA.debugLineNum = 43057172;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"DELETE FROM";
mostCurrent._b4xpages._mainpage /*SHARK2.keymon.com.mx.b4xmainpage*/ (processBA)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("DELETE FROM HIST_GPS");
 } 
       catch (Exception e13) {
			processBA.setLastException(e13);RDebugUtils.currentLine=43057174;
 //BA.debugLineNum = 43057174;BA.debugLine="LogColor(LastException, Colors.Red)";
anywheresoftware.b4a.keywords.Common.LogImpl("543057174",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
RDebugUtils.currentLine=43057177;
 //BA.debugLineNum = 43057177;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=43057182;
 //BA.debugLineNum = 43057182;BA.debugLine="If Location1.Accuracy < 100 Then";
if (_location1.getAccuracy()<100) { 
 };
RDebugUtils.currentLine=43057186;
 //BA.debugLineNum = 43057186;BA.debugLine="CallSub2(Starter, \"GPS_LocationChanged\", Location";
anywheresoftware.b4a.keywords.Common.CallSubDebug2(processBA,(Object)(mostCurrent._starter.getObject()),"GPS_LocationChanged",(Object)(_location1));
RDebugUtils.currentLine=43057190;
 //BA.debugLineNum = 43057190;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=43319296;
 //BA.debugLineNum = 43319296;BA.debugLine="Sub revisaFLP 'ignore";
RDebugUtils.currentLine=43319297;
 //BA.debugLineNum = 43319297;BA.debugLine="LogColor(\"**** **** Revisamos FLP **** ****\", Col";
anywheresoftware.b4a.keywords.Common.LogImpl("543319297","**** **** Revisamos FLP **** ****",anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (78),(int) (0),(int) (227)));
RDebugUtils.currentLine=43319298;
 //BA.debugLineNum = 43319298;BA.debugLine="Private todoBienFLP As Boolean = True";
_todobienflp = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=43319299;
 //BA.debugLineNum = 43319299;BA.debugLine="Try";
try {RDebugUtils.currentLine=43319300;
 //BA.debugLineNum = 43319300;BA.debugLine="If Not(FLP.IsInitialized) Then";
if (anywheresoftware.b4a.keywords.Common.Not(_flp.IsInitialized())) { 
RDebugUtils.currentLine=43319301;
 //BA.debugLineNum = 43319301;BA.debugLine="Subs.log2DB(\"revisaFLP: No esta inicializado ..";
mostCurrent._subs._log2db /*String*/ (processBA,"revisaFLP: No esta inicializado ... 'Reinicializando FLP'");
RDebugUtils.currentLine=43319302;
 //BA.debugLineNum = 43319302;BA.debugLine="FLP.Initialize(\"flp\")";
_flp.Initialize(processBA,"flp");
RDebugUtils.currentLine=43319303;
 //BA.debugLineNum = 43319303;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
 } 
       catch (Exception e10) {
			processBA.setLastException(e10);RDebugUtils.currentLine=43319306;
 //BA.debugLineNum = 43319306;BA.debugLine="LogColor(\"If Not(Tracker.FLP.IsInitialized) -->";
anywheresoftware.b4a.keywords.Common.LogImpl("543319306","If Not(Tracker.FLP.IsInitialized) --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
RDebugUtils.currentLine=43319308;
 //BA.debugLineNum = 43319308;BA.debugLine="Try";
try {RDebugUtils.currentLine=43319309;
 //BA.debugLineNum = 43319309;BA.debugLine="If FLP.IsInitialized Then";
if (_flp.IsInitialized()) { 
RDebugUtils.currentLine=43319310;
 //BA.debugLineNum = 43319310;BA.debugLine="Try";
try {RDebugUtils.currentLine=43319311;
 //BA.debugLineNum = 43319311;BA.debugLine="If Not(FLP.IsConnected) Then";
if (anywheresoftware.b4a.keywords.Common.Not(_flp.IsConnected())) { 
RDebugUtils.currentLine=43319312;
 //BA.debugLineNum = 43319312;BA.debugLine="Subs.log2DB(\"revisaFLP: No esta conectado ...";
mostCurrent._subs._log2db /*String*/ (processBA,"revisaFLP: No esta conectado ... 'Reconectando FLP'");
RDebugUtils.currentLine=43319314;
 //BA.debugLineNum = 43319314;BA.debugLine="StartFLP";
_startflp();
RDebugUtils.currentLine=43319315;
 //BA.debugLineNum = 43319315;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
 } 
       catch (Exception e21) {
			processBA.setLastException(e21);RDebugUtils.currentLine=43319318;
 //BA.debugLineNum = 43319318;BA.debugLine="LogColor(\"If Not(Tracker.FLP.IsConnected) -->";
anywheresoftware.b4a.keywords.Common.LogImpl("543319318","If Not(Tracker.FLP.IsConnected) --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
RDebugUtils.currentLine=43319320;
 //BA.debugLineNum = 43319320;BA.debugLine="Try";
try {RDebugUtils.currentLine=43319321;
 //BA.debugLineNum = 43319321;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=43319324;
 //BA.debugLineNum = 43319324;BA.debugLine="Subs.log2DB(\"revisaFLP: 'No se esta actualiza";
mostCurrent._subs._log2db /*String*/ (processBA,"revisaFLP: 'No se esta actualizando, lo reiniciamos ...'");
RDebugUtils.currentLine=43319325;
 //BA.debugLineNum = 43319325;BA.debugLine="StartService(Me)";
anywheresoftware.b4a.keywords.Common.StartService(processBA,tracker.getObject());
RDebugUtils.currentLine=43319326;
 //BA.debugLineNum = 43319326;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
 } 
       catch (Exception e30) {
			processBA.setLastException(e30);RDebugUtils.currentLine=43319329;
 //BA.debugLineNum = 43319329;BA.debugLine="LogColor(\"If FLP.IsConnectctd and FLP.getLKL.I";
anywheresoftware.b4a.keywords.Common.LogImpl("543319329","If FLP.IsConnectctd and FLP.getLKL.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
 };
RDebugUtils.currentLine=43319332;
 //BA.debugLineNum = 43319332;BA.debugLine="If todoBienFLP Then LogColor(\" +++ +++ Sin error";
if (_todobienflp) { 
anywheresoftware.b4a.keywords.Common.LogImpl("543319332"," +++ +++ Sin errores en FLP",anywheresoftware.b4a.keywords.Common.Colors.Green);};
 } 
       catch (Exception e35) {
			processBA.setLastException(e35);RDebugUtils.currentLine=43319334;
 //BA.debugLineNum = 43319334;BA.debugLine="LogColor(\"If Tracker.FLP.IsInitialized --> \"&Las";
anywheresoftware.b4a.keywords.Common.LogImpl("543319334","If Tracker.FLP.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
RDebugUtils.currentLine=43319337;
 //BA.debugLineNum = 43319337;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(SHARK2.keymon.com.mx.tracker parent) {
this.parent = parent;
}
SHARK2.keymon.com.mx.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=42663938;
 //BA.debugLineNum = 42663938;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=42663939;
 //BA.debugLineNum = 42663939;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=42663944;
 //BA.debugLineNum = 42663944;BA.debugLine="FLP.RequestLocationUpdates(CreateLocationRequest)";
parent._flp.RequestLocationUpdates((com.google.android.gms.location.LocationRequest)(_createlocationrequest().getObject()));
RDebugUtils.currentLine=42663947;
 //BA.debugLineNum = 42663947;BA.debugLine="flpStarted = True";
parent._flpstarted = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=42663949;
 //BA.debugLineNum = 42663949;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=43384832;
 //BA.debugLineNum = 43384832;BA.debugLine="Sub revisaUUG 'ignore";
RDebugUtils.currentLine=43384833;
 //BA.debugLineNum = 43384833;BA.debugLine="Try";
try {RDebugUtils.currentLine=43384835;
 //BA.debugLineNum = 43384835;BA.debugLine="If FLP.IsInitialized And FLP.IsConnected Then";
if (_flp.IsInitialized() && _flp.IsConnected()) { 
RDebugUtils.currentLine=43384836;
 //BA.debugLineNum = 43384836;BA.debugLine="Try";
try {RDebugUtils.currentLine=43384837;
 //BA.debugLineNum = 43384837;BA.debugLine="If FLP.GetLastKnownLocation.IsInitialized Then";
if (_flp.GetLastKnownLocation().IsInitialized()) { 
RDebugUtils.currentLine=43384839;
 //BA.debugLineNum = 43384839;BA.debugLine="Dim daa As Int = UUGCoords.DistanceTo(FLP.Get";
_daa = (int) (_uugcoords.DistanceTo((android.location.Location)(_flp.GetLastKnownLocation().getObject())));
RDebugUtils.currentLine=43384840;
 //BA.debugLineNum = 43384840;BA.debugLine="If Starter.Logger Then LogColor($\"**** UUC \"$";
if (mostCurrent._starter._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("543384840",("**** 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=43384841;
 //BA.debugLineNum = 43384841;BA.debugLine="If daa > 40 And FLP.GetLastKnownLocation.Accu";
if (_daa>40 && _flp.GetLastKnownLocation().getAccuracy()<35) { 
RDebugUtils.currentLine=43384842;
 //BA.debugLineNum = 43384842;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT";
mostCurrent._b4xpages._mainpage /*SHARK2.keymon.com.mx.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=43384843;
 //BA.debugLineNum = 43384843;BA.debugLine="If Starter.Logger Then Log(\"++++ Distancia a";
if (mostCurrent._starter._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("543384843","++++ Distancia a anterior="+BA.NumberToString(_daa)+"|"+"Precision="+BA.NumberToString(_flp.GetLastKnownLocation().getAccuracy()),0);};
 };
RDebugUtils.currentLine=43384845;
 //BA.debugLineNum = 43384845;BA.debugLine="UUGCoords = FLP.GetLastKnownLocation";
_uugcoords = _flp.GetLastKnownLocation();
 };
 } 
       catch (Exception e14) {
			processBA.setLastException(e14);RDebugUtils.currentLine=43384848;
 //BA.debugLineNum = 43384848;BA.debugLine="LogColor(\"FLP.GetLastKnownLocation.IsInitializ";
anywheresoftware.b4a.keywords.Common.LogImpl("543384848","FLP.GetLastKnownLocation.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
 }else {
RDebugUtils.currentLine=43384851;
 //BA.debugLineNum = 43384851;BA.debugLine="Log(\"StartFLP\")";
anywheresoftware.b4a.keywords.Common.LogImpl("543384851","StartFLP",0);
RDebugUtils.currentLine=43384852;
 //BA.debugLineNum = 43384852;BA.debugLine="StartFLP";
_startflp();
 };
 } 
       catch (Exception e21) {
			processBA.setLastException(e21);RDebugUtils.currentLine=43384855;
 //BA.debugLineNum = 43384855;BA.debugLine="LogColor(\"If FLP.IsInitialized --> \"&LastExcepti";
anywheresoftware.b4a.keywords.Common.LogImpl("543384855","If FLP.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
RDebugUtils.currentLine=43384857;
 //BA.debugLineNum = 43384857;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=42336256;
 //BA.debugLineNum = 42336256;BA.debugLine="Sub Service_Create";
RDebugUtils.currentLine=42336257;
 //BA.debugLineNum = 42336257;BA.debugLine="Service.AutomaticForegroundMode = Service.AUTOMAT";
mostCurrent._service.AutomaticForegroundMode = mostCurrent._service.AUTOMATIC_FOREGROUND_NEVER;
RDebugUtils.currentLine=42336259;
 //BA.debugLineNum = 42336259;BA.debugLine="FLP.Initialize(\"flp\")";
_flp.Initialize(processBA,"flp");
RDebugUtils.currentLine=42336260;
 //BA.debugLineNum = 42336260;BA.debugLine="FLP.Connect";
_flp.Connect();
RDebugUtils.currentLine=42336261;
 //BA.debugLineNum = 42336261;BA.debugLine="lock.PartialLock";
_lock.PartialLock(processBA);
RDebugUtils.currentLine=42336262;
 //BA.debugLineNum = 42336262;BA.debugLine="StartFLP";
_startflp();
RDebugUtils.currentLine=42336263;
 //BA.debugLineNum = 42336263;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=43188224;
 //BA.debugLineNum = 43188224;BA.debugLine="Sub Service_Destroy";
RDebugUtils.currentLine=43188225;
 //BA.debugLineNum = 43188225;BA.debugLine="If Tracking Then";
if (_tracking) { 
RDebugUtils.currentLine=43188226;
 //BA.debugLineNum = 43188226;BA.debugLine="StopFLP";
_stopflp();
 };
RDebugUtils.currentLine=43188228;
 //BA.debugLineNum = 43188228;BA.debugLine="Tracking = False";
_tracking = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=43188229;
 //BA.debugLineNum = 43188229;BA.debugLine="lock.ReleasePartialLock";
_lock.ReleasePartialLock();
RDebugUtils.currentLine=43188230;
 //BA.debugLineNum = 43188230;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=42991616;
 //BA.debugLineNum = 42991616;BA.debugLine="Public Sub StopFLP";
RDebugUtils.currentLine=42991618;
 //BA.debugLineNum = 42991618;BA.debugLine="If flpStarted Then";
if (_flpstarted) { 
RDebugUtils.currentLine=42991619;
 //BA.debugLineNum = 42991619;BA.debugLine="FLP.RemoveLocationUpdates  'Eliminamos todas las";
_flp.RemoveLocationUpdates();
RDebugUtils.currentLine=42991620;
 //BA.debugLineNum = 42991620;BA.debugLine="flpStarted = False";
_flpstarted = anywheresoftware.b4a.keywords.Common.False;
 };
RDebugUtils.currentLine=42991622;
 //BA.debugLineNum = 42991622;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=42532864;
 //BA.debugLineNum = 42532864;BA.debugLine="Sub Service_Start (StartingIntent As Intent)";
RDebugUtils.currentLine=42532866;
 //BA.debugLineNum = 42532866;BA.debugLine="Service.StopAutomaticForeground";
mostCurrent._service.StopAutomaticForeground();
RDebugUtils.currentLine=42532867;
 //BA.debugLineNum = 42532867;BA.debugLine="Service.StartForeground(nid, CreateNotification(\"";
mostCurrent._service.StartForeground(_nid,(android.app.Notification)(_createnotification("...").getObject()));
RDebugUtils.currentLine=42532868;
 //BA.debugLineNum = 42532868;BA.debugLine="Track";
_track();
RDebugUtils.currentLine=42532869;
 //BA.debugLineNum = 42532869;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=42532870;
 //BA.debugLineNum = 42532870;BA.debugLine="FLP.GetLastKnownLocation.Initialize";
_flp.GetLastKnownLocation().Initialize();
RDebugUtils.currentLine=42532871;
 //BA.debugLineNum = 42532871;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=42598400;
 //BA.debugLineNum = 42598400;BA.debugLine="Public Sub Track";
RDebugUtils.currentLine=42598402;
 //BA.debugLineNum = 42598402;BA.debugLine="If Not(FLP.IsInitialized) Then FLP.Initialize(\"fl";
if (anywheresoftware.b4a.keywords.Common.Not(_flp.IsInitialized())) { 
_flp.Initialize(processBA,"flp");};
RDebugUtils.currentLine=42598403;
 //BA.debugLineNum = 42598403;BA.debugLine="If Not(FLP.IsConnected) Then FLP.Connect";
if (anywheresoftware.b4a.keywords.Common.Not(_flp.IsConnected())) { 
_flp.Connect();};
RDebugUtils.currentLine=42598404;
 //BA.debugLineNum = 42598404;BA.debugLine="If Tracking And actualLR.IsInitialized Then";
if (_tracking && _actuallr.IsInitialized()) { 
RDebugUtils.currentLine=42598406;
 //BA.debugLineNum = 42598406;BA.debugLine="Return 'Si ya estamos \"rastreando\" no hacemos na";
if (true) return "";
 };
RDebugUtils.currentLine=42598408;
 //BA.debugLineNum = 42598408;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=42598409;
 //BA.debugLineNum = 42598409;BA.debugLine="Log(\"No permission\")";
anywheresoftware.b4a.keywords.Common.LogImpl("542598409","No permission",0);
RDebugUtils.currentLine=42598410;
 //BA.debugLineNum = 42598410;BA.debugLine="Return";
if (true) return "";
 };
RDebugUtils.currentLine=42598412;
 //BA.debugLineNum = 42598412;BA.debugLine="StartFLP 'Iniciamos FusedLocationProvider";
_startflp();
RDebugUtils.currentLine=42598413;
 //BA.debugLineNum = 42598413;BA.debugLine="Tracking = True";
_tracking = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=42598414;
 //BA.debugLineNum = 42598414;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(SHARK2.keymon.com.mx.tracker parent) {
this.parent = parent;
}
SHARK2.keymon.com.mx.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=42729474;
 //BA.debugLineNum = 42729474;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=42729475;
 //BA.debugLineNum = 42729475;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=42729476;
 //BA.debugLineNum = 42729476;BA.debugLine="Log(\"sleeping\")";
anywheresoftware.b4a.keywords.Common.LogImpl("542729476","sleeping",0);
 if (true) break;

case 4:
//C
this.state = -1;
;
RDebugUtils.currentLine=42729478;
 //BA.debugLineNum = 42729478;BA.debugLine="dameUltimaUbicacionConocida 'Regresamos ultima ub";
_dameultimaubicacionconocida();
RDebugUtils.currentLine=42729479;
 //BA.debugLineNum = 42729479;BA.debugLine="FLP.RequestLocationUpdates(CreateLocationRequestS";
parent._flp.RequestLocationUpdates((com.google.android.gms.location.LocationRequest)(_createlocationrequestsmalld().getObject()));
RDebugUtils.currentLine=42729482;
 //BA.debugLineNum = 42729482;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
}