package SHARK2.keymon.com.mx;


import anywheresoftware.b4a.B4AMenuItem;
import android.app.Activity;
import android.os.Bundle;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.B4AActivity;
import anywheresoftware.b4a.ObjectWrapper;
import anywheresoftware.b4a.objects.ActivityWrapper;
import java.lang.reflect.InvocationTargetException;
import anywheresoftware.b4a.B4AUncaughtException;
import anywheresoftware.b4a.debug.*;
import java.lang.ref.WeakReference;

public class mapa_rutas extends Activity implements B4AActivity{
	public static mapa_rutas mostCurrent;
	static boolean afterFirstLayout;
	static boolean isFirst = true;
    private static boolean processGlobalsRun = false;
	BALayout layout;
	public static BA processBA;
	BA activityBA;
    ActivityWrapper _activity;
    java.util.ArrayList<B4AMenuItem> menuItems;
	public static final boolean fullScreen = false;
	public static final boolean includeTitle = false;
    public static WeakReference<Activity> previousOne;
    public static boolean dontPause;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        mostCurrent = this;
		if (processBA == null) {
			processBA = new anywheresoftware.b4a.ShellBA(this.getApplicationContext(), null, null, "SHARK2.keymon.com.mx", "SHARK2.keymon.com.mx.mapa_rutas");
			processBA.loadHtSubs(this.getClass());
	        float deviceScale = getApplicationContext().getResources().getDisplayMetrics().density;
	        BALayout.setDeviceScale(deviceScale);
            
		}
		else if (previousOne != null) {
			Activity p = previousOne.get();
			if (p != null && p != this) {
                BA.LogInfo("Killing previous instance (mapa_rutas).");
				p.finish();
			}
		}
        processBA.setActivityPaused(true);
        processBA.runHook("oncreate", this, null);
		if (!includeTitle) {
        	this.getWindow().requestFeature(android.view.Window.FEATURE_NO_TITLE);
        }
        if (fullScreen) {
        	getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN,   
        			android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
		
        processBA.sharedProcessBA.activityBA = null;
		layout = new BALayout(this);
		setContentView(layout);
		afterFirstLayout = false;
        WaitForLayout wl = new WaitForLayout();
        if (anywheresoftware.b4a.objects.ServiceHelper.StarterHelper.startFromActivity(this, processBA, wl, false))
		    BA.handler.postDelayed(wl, 5);

	}
	static class WaitForLayout implements Runnable {
		public void run() {
			if (afterFirstLayout)
				return;
			if (mostCurrent == null)
				return;
            
			if (mostCurrent.layout.getWidth() == 0) {
				BA.handler.postDelayed(this, 5);
				return;
			}
			mostCurrent.layout.getLayoutParams().height = mostCurrent.layout.getHeight();
			mostCurrent.layout.getLayoutParams().width = mostCurrent.layout.getWidth();
			afterFirstLayout = true;
			mostCurrent.afterFirstLayout();
		}
	}
	private void afterFirstLayout() {
        if (this != mostCurrent)
			return;
		activityBA = new BA(this, layout, processBA, "SHARK2.keymon.com.mx", "SHARK2.keymon.com.mx.mapa_rutas");
        
        processBA.sharedProcessBA.activityBA = new java.lang.ref.WeakReference<BA>(activityBA);
        anywheresoftware.b4a.objects.ViewWrapper.lastId = 0;
        _activity = new ActivityWrapper(activityBA, "activity");
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        if (BA.isShellModeRuntimeCheck(processBA)) {
			if (isFirst)
				processBA.raiseEvent2(null, true, "SHELL", false);
			processBA.raiseEvent2(null, true, "CREATE", true, "SHARK2.keymon.com.mx.mapa_rutas", processBA, activityBA, _activity, anywheresoftware.b4a.keywords.Common.Density, mostCurrent);
			_activity.reinitializeForShell(activityBA, "activity");
		}
        initializeProcessGlobals();		
        initializeGlobals();
        
        BA.LogInfo("** Activity (mapa_rutas) Create " + (isFirst ? "(first time)" : "") + " **");
        processBA.raiseEvent2(null, true, "activity_create", false, isFirst);
		isFirst = false;
		if (this != mostCurrent)
			return;
        processBA.setActivityPaused(false);
        BA.LogInfo("** Activity (mapa_rutas) Resume **");
        processBA.raiseEvent(null, "activity_resume");
        if (android.os.Build.VERSION.SDK_INT >= 11) {
			try {
				android.app.Activity.class.getMethod("invalidateOptionsMenu").invoke(this,(Object[]) null);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

	}
	public void addMenuItem(B4AMenuItem item) {
		if (menuItems == null)
			menuItems = new java.util.ArrayList<B4AMenuItem>();
		menuItems.add(item);
	}
	@Override
	public boolean onCreateOptionsMenu(android.view.Menu menu) {
		super.onCreateOptionsMenu(menu);
        try {
            if (processBA.subExists("activity_actionbarhomeclick")) {
                Class.forName("android.app.ActionBar").getMethod("setHomeButtonEnabled", boolean.class).invoke(
                    getClass().getMethod("getActionBar").invoke(this), true);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (processBA.runHook("oncreateoptionsmenu", this, new Object[] {menu}))
            return true;
		if (menuItems == null)
			return false;
		for (B4AMenuItem bmi : menuItems) {
			android.view.MenuItem mi = menu.add(bmi.title);
			if (bmi.drawable != null)
				mi.setIcon(bmi.drawable);
            if (android.os.Build.VERSION.SDK_INT >= 11) {
				try {
                    if (bmi.addToBar) {
				        android.view.MenuItem.class.getMethod("setShowAsAction", int.class).invoke(mi, 1);
                    }
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			mi.setOnMenuItemClickListener(new B4AMenuItemsClickListener(bmi.eventName.toLowerCase(BA.cul)));
		}
        
		return true;
	}   
 @Override
 public boolean onOptionsItemSelected(android.view.MenuItem item) {
    if (item.getItemId() == 16908332) {
        processBA.raiseEvent(null, "activity_actionbarhomeclick");
        return true;
    }
    else
        return super.onOptionsItemSelected(item); 
}
@Override
 public boolean onPrepareOptionsMenu(android.view.Menu menu) {
    super.onPrepareOptionsMenu(menu);
    processBA.runHook("onprepareoptionsmenu", this, new Object[] {menu});
    return true;
    
 }
 protected void onStart() {
    super.onStart();
    processBA.runHook("onstart", this, null);
}
 protected void onStop() {
    super.onStop();
    processBA.runHook("onstop", this, null);
}
    public void onWindowFocusChanged(boolean hasFocus) {
       super.onWindowFocusChanged(hasFocus);
       if (processBA.subExists("activity_windowfocuschanged"))
           processBA.raiseEvent2(null, true, "activity_windowfocuschanged", false, hasFocus);
    }
	private class B4AMenuItemsClickListener implements android.view.MenuItem.OnMenuItemClickListener {
		private final String eventName;
		public B4AMenuItemsClickListener(String eventName) {
			this.eventName = eventName;
		}
		public boolean onMenuItemClick(android.view.MenuItem item) {
			processBA.raiseEventFromUI(item.getTitle(), eventName + "_click");
			return true;
		}
	}
    public static Class<?> getObject() {
		return mapa_rutas.class;
	}
    private Boolean onKeySubExist = null;
    private Boolean onKeyUpSubExist = null;
	@Override
	public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
        if (processBA.runHook("onkeydown", this, new Object[] {keyCode, event}))
            return true;
		if (onKeySubExist == null)
			onKeySubExist = processBA.subExists("activity_keypress");
		if (onKeySubExist) {
			if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK &&
					android.os.Build.VERSION.SDK_INT >= 18) {
				HandleKeyDelayed hk = new HandleKeyDelayed();
				hk.kc = keyCode;
				BA.handler.post(hk);
				return true;
			}
			else {
				boolean res = new HandleKeyDelayed().runDirectly(keyCode);
				if (res)
					return true;
			}
		}
		return super.onKeyDown(keyCode, event);
	}
	private class HandleKeyDelayed implements Runnable {
		int kc;
		public void run() {
			runDirectly(kc);
		}
		public boolean runDirectly(int keyCode) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keypress", false, keyCode);
			if (res == null || res == true) {
                return true;
            }
            else if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK) {
				finish();
				return true;
			}
            return false;
		}
		
	}
    @Override
	public boolean onKeyUp(int keyCode, android.view.KeyEvent event) {
        if (processBA.runHook("onkeyup", this, new Object[] {keyCode, event}))
            return true;
		if (onKeyUpSubExist == null)
			onKeyUpSubExist = processBA.subExists("activity_keyup");
		if (onKeyUpSubExist) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keyup", false, keyCode);
			if (res == null || res == true)
				return true;
		}
		return super.onKeyUp(keyCode, event);
	}
	@Override
	public void onNewIntent(android.content.Intent intent) {
        super.onNewIntent(intent);
		this.setIntent(intent);
        processBA.runHook("onnewintent", this, new Object[] {intent});
	}
    @Override 
	public void onPause() {
		super.onPause();
        if (_activity == null)
            return;
        if (this != mostCurrent)
			return;
		anywheresoftware.b4a.Msgbox.dismiss(true);
        if (!dontPause)
            BA.LogInfo("** Activity (mapa_rutas) Pause, UserClosed = " + activityBA.activity.isFinishing() + " **");
        else
            BA.LogInfo("** Activity (mapa_rutas) Pause event (activity is not paused). **");
        if (mostCurrent != null)
            processBA.raiseEvent2(_activity, true, "activity_pause", false, activityBA.activity.isFinishing());		
        if (!dontPause) {
            processBA.setActivityPaused(true);
            mostCurrent = null;
        }

        if (!activityBA.activity.isFinishing())
			previousOne = new WeakReference<Activity>(this);
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        processBA.runHook("onpause", this, null);
	}

	@Override
	public void onDestroy() {
        super.onDestroy();
		previousOne = null;
        processBA.runHook("ondestroy", this, null);
	}
    @Override 
	public void onResume() {
		super.onResume();
        mostCurrent = this;
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        if (activityBA != null) { //will be null during activity create (which waits for AfterLayout).
        	ResumeMessage rm = new ResumeMessage(mostCurrent);
        	BA.handler.post(rm);
        }
        processBA.runHook("onresume", this, null);
	}
    private static class ResumeMessage implements Runnable {
    	private final WeakReference<Activity> activity;
    	public ResumeMessage(Activity activity) {
    		this.activity = new WeakReference<Activity>(activity);
    	}
		public void run() {
            mapa_rutas mc = mostCurrent;
			if (mc == null || mc != activity.get())
				return;
			processBA.setActivityPaused(false);
            BA.LogInfo("** Activity (mapa_rutas) Resume **");
            if (mc != mostCurrent)
                return;
		    processBA.raiseEvent(mc._activity, "activity_resume", (Object[])null);
		}
    }
	@Override
	protected void onActivityResult(int requestCode, int resultCode,
	      android.content.Intent data) {
		processBA.onActivityResult(requestCode, resultCode, data);
        processBA.runHook("onactivityresult", this, new Object[] {requestCode, resultCode});
	}
	private static void initializeGlobals() {
		processBA.raiseEvent2(null, true, "globals", false, (Object[])null);
	}
    public void onRequestPermissionsResult(int requestCode,
        String permissions[], int[] grantResults) {
        for (int i = 0;i < permissions.length;i++) {
            Object[] o = new Object[] {permissions[i], grantResults[i] == 0};
            processBA.raiseEventFromDifferentThread(null,null, 0, "activity_permissionresult", true, o);
        }
            
    }



public static void initializeProcessGlobals() {
             try {
                Class.forName(BA.applicationContext.getPackageName() + ".main").getMethod("initializeProcessGlobals").invoke(null, null);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
}
public anywheresoftware.b4a.keywords.Common __c = null;
public static anywheresoftware.b4a.gps.GPS _gps = null;
public static anywheresoftware.b4a.objects.RuntimePermissions _rp = null;
public static String _ruta = "";
public static anywheresoftware.b4a.sql.SQL _skmt = null;
public static anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public static anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = null;
public static anywheresoftware.b4a.sql.SQL.CursorWrapper _c22 = null;
public static anywheresoftware.b4a.sql.SQL.CursorWrapper _c3 = null;
public anywheresoftware.b4a.objects.MapFragmentWrapper.GoogleMapWrapper _gmap = null;
public anywheresoftware.b4a.objects.MapFragmentWrapper _mapfragment1 = null;
public static double _latitud = 0;
public static double _longitud = 0;
public static double _lat2 = 0;
public static double _lon2 = 0;
public anywheresoftware.b4a.gps.LocationWrapper _p1 = null;
public anywheresoftware.b4a.gps.LocationWrapper _p2 = null;
public static float _distance = 0f;
public anywheresoftware.b4a.objects.ButtonWrapper _boton1 = null;
public static float _hue_blue = 0f;
public static float _hue_red = 0f;
public static float _hue_green = 0f;
public anywheresoftware.b4a.objects.ButtonWrapper _b_azul = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_rojo = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_verde = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_todos = null;
public static String _tienda = "";
public static double _latitudru = 0;
public static double _longitudru = 0;
public anywheresoftware.b4a.objects.collections.List _list_azul = null;
public anywheresoftware.b4a.objects.collections.List _list_rojo = null;
public anywheresoftware.b4a.objects.collections.List _list_verde = null;
public anywheresoftware.b4a.objects.MapFragmentWrapper.MarkerWrapper _mark_azul = null;
public anywheresoftware.b4a.objects.MapFragmentWrapper.MarkerWrapper _mark_rojo = null;
public anywheresoftware.b4a.objects.MapFragmentWrapper.MarkerWrapper _mark_verde = null;
public anywheresoftware.b4a.objects.MapFragmentWrapper.MarkerWrapper _mark_cedis = null;
public static String _rojo = "";
public static String _azul = "";
public static String _verde = "";
public static String _todos = "";
public static int _numserie = 0;
public uk.co.martinpearman.b4a.com.google.android.gms.maps.googlemap.OnInfoWindowClickListener _oninfowindowclicklistener1 = null;
public uk.co.martinpearman.b4a.googlemapsextras.GoogleMapsExtras _googlemapextra = null;
public static String _codigo = "";
public static String _semana = "";
public anywheresoftware.b4a.objects.collections.List _lista_punta = null;
public anywheresoftware.b4a.objects.collections.List _lista_punta2 = 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.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.tracker _tracker = 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 void  _activity_create(boolean _firsttime) throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "activity_create", false))
	 {Debug.delegate(mostCurrent.activityBA, "activity_create", new Object[] {_firsttime}); return;}
ResumableSub_Activity_Create rsub = new ResumableSub_Activity_Create(null,_firsttime);
rsub.resume(processBA, null);
}
public static class ResumableSub_Activity_Create extends BA.ResumableSub {
public ResumableSub_Activity_Create(SHARK2.keymon.com.mx.mapa_rutas parent,boolean _firsttime) {
this.parent = parent;
this._firsttime = _firsttime;
}
SHARK2.keymon.com.mx.mapa_rutas parent;
boolean _firsttime;
String _permission = "";
boolean _result = false;

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

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

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=33816577;
 //BA.debugLineNum = 33816577;BA.debugLine="Activity.LoadLayout(\"MAPA_RUTAS\")";
parent.mostCurrent._activity.LoadLayout("MAPA_RUTAS",mostCurrent.activityBA);
RDebugUtils.currentLine=33816581;
 //BA.debugLineNum = 33816581;BA.debugLine="ruta = File.DirInternal";
parent._ruta = anywheresoftware.b4a.keywords.Common.File.getDirInternal();
RDebugUtils.currentLine=33816583;
 //BA.debugLineNum = 33816583;BA.debugLine="If File.Exists(ruta, \"kmt.db\") = False Then";
if (true) break;

case 1:
//if
this.state = 4;
if (anywheresoftware.b4a.keywords.Common.File.Exists(parent._ruta,"kmt.db")==anywheresoftware.b4a.keywords.Common.False) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=33816584;
 //BA.debugLineNum = 33816584;BA.debugLine="File.Copy(File.DirAssets, \"kmt.db\", ruta, \"kmt.d";
anywheresoftware.b4a.keywords.Common.File.Copy(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"kmt.db",parent._ruta,"kmt.db");
 if (true) break;

case 4:
//C
this.state = 5;
;
RDebugUtils.currentLine=33816586;
 //BA.debugLineNum = 33816586;BA.debugLine="skmt.Initialize(ruta,\"kmt.db\", True)";
parent._skmt.Initialize(parent._ruta,"kmt.db",anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=33816588;
 //BA.debugLineNum = 33816588;BA.debugLine="Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_";
parent.mostCurrent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .CheckAndRequest(processBA,parent.mostCurrent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .PERMISSION_ACCESS_FINE_LOCATION);
RDebugUtils.currentLine=33816589;
 //BA.debugLineNum = 33816589;BA.debugLine="Wait For Activity_PermissionResult (Permission As";
anywheresoftware.b4a.keywords.Common.WaitFor("activity_permissionresult", processBA, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "mapa_rutas", "activity_create"), null);
this.state = 19;
return;
case 19:
//C
this.state = 5;
_permission = (String) result[0];
_result = (Boolean) result[1];
;
RDebugUtils.currentLine=33816590;
 //BA.debugLineNum = 33816590;BA.debugLine="If Result Then";
if (true) break;

case 5:
//if
this.state = 14;
if (_result) { 
this.state = 7;
}else {
this.state = 13;
}if (true) break;

case 7:
//C
this.state = 8;
RDebugUtils.currentLine=33816591;
 //BA.debugLineNum = 33816591;BA.debugLine="StartService(Tracker)";
anywheresoftware.b4a.keywords.Common.StartService(processBA,(Object)(parent.mostCurrent._tracker.getObject()));
RDebugUtils.currentLine=33816592;
 //BA.debugLineNum = 33816592;BA.debugLine="Log(\"Start Tracker\")";
anywheresoftware.b4a.keywords.Common.LogImpl("533816592","Start Tracker",0);
RDebugUtils.currentLine=33816593;
 //BA.debugLineNum = 33816593;BA.debugLine="If MapFragment1.IsGooglePlayServicesAvailable =";
if (true) break;

case 8:
//if
this.state = 11;
if (parent.mostCurrent._mapfragment1.IsGooglePlayServicesAvailable(mostCurrent.activityBA)==anywheresoftware.b4a.keywords.Common.False) { 
this.state = 10;
}if (true) break;

case 10:
//C
this.state = 11;
RDebugUtils.currentLine=33816594;
 //BA.debugLineNum = 33816594;BA.debugLine="ToastMessageShow(\"Please install Google Play Se";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Please install Google Play Services."),anywheresoftware.b4a.keywords.Common.True);
 if (true) break;

case 11:
//C
this.state = 14;
;
 if (true) break;

case 13:
//C
this.state = 14;
RDebugUtils.currentLine=33816597;
 //BA.debugLineNum = 33816597;BA.debugLine="ToastMessageShow(\"No permission\", True)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("No permission"),anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=33816598;
 //BA.debugLineNum = 33816598;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
parent.mostCurrent._b4xpages._showpage /*String*/ (mostCurrent.activityBA,"Principal");
 if (true) break;

case 14:
//C
this.state = 15;
;
RDebugUtils.currentLine=33816613;
 //BA.debugLineNum = 33816613;BA.debugLine="MARK_AZUL.IsInitialized";
parent.mostCurrent._mark_azul.IsInitialized();
RDebugUtils.currentLine=33816614;
 //BA.debugLineNum = 33816614;BA.debugLine="MARK_ROJO.IsInitialized";
parent.mostCurrent._mark_rojo.IsInitialized();
RDebugUtils.currentLine=33816615;
 //BA.debugLineNum = 33816615;BA.debugLine="MARK_VERDE.IsInitialized";
parent.mostCurrent._mark_verde.IsInitialized();
RDebugUtils.currentLine=33816616;
 //BA.debugLineNum = 33816616;BA.debugLine="LIST_AZUL.Initialize";
parent.mostCurrent._list_azul.Initialize();
RDebugUtils.currentLine=33816617;
 //BA.debugLineNum = 33816617;BA.debugLine="LIST_ROJO.Initialize";
parent.mostCurrent._list_rojo.Initialize();
RDebugUtils.currentLine=33816618;
 //BA.debugLineNum = 33816618;BA.debugLine="LIST_VERDE.Initialize";
parent.mostCurrent._list_verde.Initialize();
RDebugUtils.currentLine=33816619;
 //BA.debugLineNum = 33816619;BA.debugLine="verde = 0";
parent.mostCurrent._verde = BA.NumberToString(0);
RDebugUtils.currentLine=33816620;
 //BA.debugLineNum = 33816620;BA.debugLine="azul = 0";
parent.mostCurrent._azul = BA.NumberToString(0);
RDebugUtils.currentLine=33816621;
 //BA.debugLineNum = 33816621;BA.debugLine="rojo = 0";
parent.mostCurrent._rojo = BA.NumberToString(0);
RDebugUtils.currentLine=33816622;
 //BA.debugLineNum = 33816622;BA.debugLine="todos = 1";
parent.mostCurrent._todos = BA.NumberToString(1);
RDebugUtils.currentLine=33816623;
 //BA.debugLineNum = 33816623;BA.debugLine="c=skmt.ExecQuery2(\"select count(*) AS CUANTOS fro";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("select count(*) AS CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",new String[]{"SEMANA"})));
RDebugUtils.currentLine=33816624;
 //BA.debugLineNum = 33816624;BA.debugLine="c.Position =0";
parent._c.setPosition((int) (0));
RDebugUtils.currentLine=33816625;
 //BA.debugLineNum = 33816625;BA.debugLine="SEMANA = c.GetString(\"CUANTOS\")";
parent.mostCurrent._semana = parent._c.GetString("CUANTOS");
RDebugUtils.currentLine=33816626;
 //BA.debugLineNum = 33816626;BA.debugLine="c.Close";
parent._c.Close();
RDebugUtils.currentLine=33816628;
 //BA.debugLineNum = 33816628;BA.debugLine="If SEMANA > 0 Then";
if (true) break;

case 15:
//if
this.state = 18;
if ((double)(Double.parseDouble(parent.mostCurrent._semana))>0) { 
this.state = 17;
}if (true) break;

case 17:
//C
this.state = 18;
RDebugUtils.currentLine=33816629;
 //BA.debugLineNum = 33816629;BA.debugLine="c=skmt.ExecQuery2(\"select CAT_VA_VALOR from CAT_";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",new String[]{"SEMANA"})));
RDebugUtils.currentLine=33816630;
 //BA.debugLineNum = 33816630;BA.debugLine="c.Position =0";
parent._c.setPosition((int) (0));
RDebugUtils.currentLine=33816631;
 //BA.debugLineNum = 33816631;BA.debugLine="SEMANA = c.GetString(\"CAT_VA_VALOR\")";
parent.mostCurrent._semana = parent._c.GetString("CAT_VA_VALOR");
RDebugUtils.currentLine=33816632;
 //BA.debugLineNum = 33816632;BA.debugLine="c.Close";
parent._c.Close();
 if (true) break;

case 18:
//C
this.state = -1;
;
RDebugUtils.currentLine=33816634;
 //BA.debugLineNum = 33816634;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static String  _activity_pause(boolean _userclosed) throws Exception{
RDebugUtils.currentModule="mapa_rutas";
RDebugUtils.currentLine=34144256;
 //BA.debugLineNum = 34144256;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
RDebugUtils.currentLine=34144257;
 //BA.debugLineNum = 34144257;BA.debugLine="GPS.Stop";
_gps.Stop();
RDebugUtils.currentLine=34144258;
 //BA.debugLineNum = 34144258;BA.debugLine="End Sub";
return "";
}
public static void  _activity_resume() throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "activity_resume", false))
	 {Debug.delegate(mostCurrent.activityBA, "activity_resume", null); return;}
ResumableSub_Activity_Resume rsub = new ResumableSub_Activity_Resume(null);
rsub.resume(processBA, null);
}
public static class ResumableSub_Activity_Resume extends BA.ResumableSub {
public ResumableSub_Activity_Resume(SHARK2.keymon.com.mx.mapa_rutas parent) {
this.parent = parent;
}
SHARK2.keymon.com.mx.mapa_rutas parent;
String _permission = "";
boolean _result = false;

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

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

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=33882113;
 //BA.debugLineNum = 33882113;BA.debugLine="Starter.rp.Check(Starter.rp.PERMISSION_ACCESS_FIN";
parent.mostCurrent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .Check(parent.mostCurrent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .PERMISSION_ACCESS_FINE_LOCATION);
RDebugUtils.currentLine=33882114;
 //BA.debugLineNum = 33882114;BA.debugLine="Wait For Activity_PermissionResult (Permission As";
anywheresoftware.b4a.keywords.Common.WaitFor("activity_permissionresult", processBA, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "mapa_rutas", "activity_resume"), null);
this.state = 11;
return;
case 11:
//C
this.state = 1;
_permission = (String) result[0];
_result = (Boolean) result[1];
;
RDebugUtils.currentLine=33882115;
 //BA.debugLineNum = 33882115;BA.debugLine="If Result Then";
if (true) break;

case 1:
//if
this.state = 10;
if (_result) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=33882116;
 //BA.debugLineNum = 33882116;BA.debugLine="If Starter.GPS.GPSEnabled = False Then";
if (true) break;

case 4:
//if
this.state = 9;
if (parent.mostCurrent._starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getGPSEnabled()==anywheresoftware.b4a.keywords.Common.False) { 
this.state = 6;
}else {
this.state = 8;
}if (true) break;

case 6:
//C
this.state = 9;
RDebugUtils.currentLine=33882117;
 //BA.debugLineNum = 33882117;BA.debugLine="ToastMessageShow(\"Debe Activar el GPS del Equip";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Debe Activar el GPS del Equipo."),anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=33882118;
 //BA.debugLineNum = 33882118;BA.debugLine="StartActivity(Starter.GPS.LocationSettingsInten";
anywheresoftware.b4a.keywords.Common.StartActivity(processBA,(Object)(parent.mostCurrent._starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getLocationSettingsIntent()));
 if (true) break;

case 8:
//C
this.state = 9;
RDebugUtils.currentLine=33882120;
 //BA.debugLineNum = 33882120;BA.debugLine="Starter.GPS.Start(0, 0)";
parent.mostCurrent._starter._gps /*anywheresoftware.b4a.gps.GPS*/ .Start(processBA,(long) (0),(float) (0));
 if (true) break;

case 9:
//C
this.state = 10;
;
 if (true) break;

case 10:
//C
this.state = -1;
;
RDebugUtils.currentLine=33882123;
 //BA.debugLineNum = 33882123;BA.debugLine="lista_punta.Initialize";
parent.mostCurrent._lista_punta.Initialize();
RDebugUtils.currentLine=33882124;
 //BA.debugLineNum = 33882124;BA.debugLine="lista_punta2.Initialize";
parent.mostCurrent._lista_punta2.Initialize();
RDebugUtils.currentLine=33882126;
 //BA.debugLineNum = 33882126;BA.debugLine="LIST_AZUL.Initialize";
parent.mostCurrent._list_azul.Initialize();
RDebugUtils.currentLine=33882127;
 //BA.debugLineNum = 33882127;BA.debugLine="LIST_ROJO.Initialize";
parent.mostCurrent._list_rojo.Initialize();
RDebugUtils.currentLine=33882128;
 //BA.debugLineNum = 33882128;BA.debugLine="LIST_VERDE.Initialize";
parent.mostCurrent._list_verde.Initialize();
RDebugUtils.currentLine=33882129;
 //BA.debugLineNum = 33882129;BA.debugLine="verde = 0";
parent.mostCurrent._verde = BA.NumberToString(0);
RDebugUtils.currentLine=33882130;
 //BA.debugLineNum = 33882130;BA.debugLine="azul = 1";
parent.mostCurrent._azul = BA.NumberToString(1);
RDebugUtils.currentLine=33882131;
 //BA.debugLineNum = 33882131;BA.debugLine="rojo = 0";
parent.mostCurrent._rojo = BA.NumberToString(0);
RDebugUtils.currentLine=33882132;
 //BA.debugLineNum = 33882132;BA.debugLine="todos = 0";
parent.mostCurrent._todos = BA.NumberToString(0);
RDebugUtils.currentLine=33882137;
 //BA.debugLineNum = 33882137;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static String  _b_azul_click() throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "b_azul_click", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "b_azul_click", null));}
RDebugUtils.currentLine=34406400;
 //BA.debugLineNum = 34406400;BA.debugLine="Sub B_AZUL_Click";
RDebugUtils.currentLine=34406401;
 //BA.debugLineNum = 34406401;BA.debugLine="azul = 1";
mostCurrent._azul = BA.NumberToString(1);
RDebugUtils.currentLine=34406402;
 //BA.debugLineNum = 34406402;BA.debugLine="verde = 0";
mostCurrent._verde = BA.NumberToString(0);
RDebugUtils.currentLine=34406403;
 //BA.debugLineNum = 34406403;BA.debugLine="rojo = 0";
mostCurrent._rojo = BA.NumberToString(0);
RDebugUtils.currentLine=34406404;
 //BA.debugLineNum = 34406404;BA.debugLine="todos = 0";
mostCurrent._todos = BA.NumberToString(0);
RDebugUtils.currentLine=34406405;
 //BA.debugLineNum = 34406405;BA.debugLine="gmap.Clear";
mostCurrent._gmap.Clear();
RDebugUtils.currentLine=34406407;
 //BA.debugLineNum = 34406407;BA.debugLine="MapFragment1_Ready";
_mapfragment1_ready();
RDebugUtils.currentLine=34406409;
 //BA.debugLineNum = 34406409;BA.debugLine="End Sub";
return "";
}
public static void  _mapfragment1_ready() throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "mapfragment1_ready", false))
	 {Debug.delegate(mostCurrent.activityBA, "mapfragment1_ready", null); return;}
ResumableSub_MapFragment1_Ready rsub = new ResumableSub_MapFragment1_Ready(null);
rsub.resume(processBA, null);
}
public static class ResumableSub_MapFragment1_Ready extends BA.ResumableSub {
public ResumableSub_MapFragment1_Ready(SHARK2.keymon.com.mx.mapa_rutas parent) {
this.parent = parent;
}
SHARK2.keymon.com.mx.mapa_rutas parent;
String _permission = "";
boolean _result = false;
anywheresoftware.b4j.object.JavaObject _javamapsobject = null;
int _i = 0;
anywheresoftware.b4a.objects.MapFragmentWrapper.CameraPositionWrapper _aa = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _pol = null;
int _poli = 0;
anywheresoftware.b4a.objects.MapFragmentWrapper.LatLngWrapper _coords = null;
int step15;
int limit15;
int step35;
int limit35;
int step51;
int limit51;
int step68;
int limit68;
int step82;
int limit82;
int step103;
int limit103;

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

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

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=33947649;
 //BA.debugLineNum = 33947649;BA.debugLine="Log(\"ENTRANDO MapFragment1_Ready\")";
anywheresoftware.b4a.keywords.Common.LogImpl("533947649","ENTRANDO MapFragment1_Ready",0);
RDebugUtils.currentLine=33947650;
 //BA.debugLineNum = 33947650;BA.debugLine="gmap = MapFragment1.GetMap";
parent.mostCurrent._gmap = parent.mostCurrent._mapfragment1.GetMap();
RDebugUtils.currentLine=33947651;
 //BA.debugLineNum = 33947651;BA.debugLine="gmap.IsInitialized";
parent.mostCurrent._gmap.IsInitialized();
RDebugUtils.currentLine=33947655;
 //BA.debugLineNum = 33947655;BA.debugLine="rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCA";
parent._rp.CheckAndRequest(processBA,parent._rp.PERMISSION_ACCESS_FINE_LOCATION);
RDebugUtils.currentLine=33947656;
 //BA.debugLineNum = 33947656;BA.debugLine="Wait For Activity_PermissionResult (Permission As";
anywheresoftware.b4a.keywords.Common.WaitFor("activity_permissionresult", processBA, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "mapa_rutas", "mapfragment1_ready"), null);
this.state = 91;
return;
case 91:
//C
this.state = 1;
_permission = (String) result[0];
_result = (Boolean) result[1];
;
RDebugUtils.currentLine=33947657;
 //BA.debugLineNum = 33947657;BA.debugLine="gmap.MyLocationEnabled = Result";
parent.mostCurrent._gmap.setMyLocationEnabled(_result);
RDebugUtils.currentLine=33947659;
 //BA.debugLineNum = 33947659;BA.debugLine="Dim JavaMapsObject As JavaObject";
_javamapsobject = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=33947660;
 //BA.debugLineNum = 33947660;BA.debugLine="JavaMapsObject = gmap.GetUiSettings";
_javamapsobject = (anywheresoftware.b4j.object.JavaObject) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.object.JavaObject(), (java.lang.Object)(parent.mostCurrent._gmap.GetUiSettings().getObject()));
RDebugUtils.currentLine=33947661;
 //BA.debugLineNum = 33947661;BA.debugLine="JavaMapsObject.RunMethod(\"setMapToolbarEnabled\",";
_javamapsobject.RunMethod("setMapToolbarEnabled",new Object[]{(Object)(anywheresoftware.b4a.keywords.Common.True)});
RDebugUtils.currentLine=33947663;
 //BA.debugLineNum = 33947663;BA.debugLine="If azul = 1 Or todos = 1  Then";
if (true) break;

case 1:
//if
this.state = 30;
if ((parent.mostCurrent._azul).equals(BA.NumberToString(1)) || (parent.mostCurrent._todos).equals(BA.NumberToString(1))) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=33947664;
 //BA.debugLineNum = 33947664;BA.debugLine="c.IsInitialized";
parent._c.IsInitialized();
RDebugUtils.currentLine=33947665;
 //BA.debugLineNum = 33947665;BA.debugLine="c=skmt.ExecQuery(\"select CAT_CL_CODIGO,CAT_CL_NO";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("select CAT_CL_CODIGO,CAT_CL_NOMBRE,CAT_CL_LAT,CAT_CL_LONG from kmt_info where gestion = 0 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0 and CAT_CL_LAT <> ' ' and CAT_CL_LONG <> ' ' and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")));
RDebugUtils.currentLine=33947667;
 //BA.debugLineNum = 33947667;BA.debugLine="Log($\"============== Resultados = ${c.RowCount}\"";
anywheresoftware.b4a.keywords.Common.LogImpl("533947667",("============== Resultados = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(parent._c.getRowCount()))+""),0);
RDebugUtils.currentLine=33947668;
 //BA.debugLineNum = 33947668;BA.debugLine="If c.RowCount > 0 Then";
if (true) break;

case 4:
//if
this.state = 23;
if (parent._c.getRowCount()>0) { 
this.state = 6;
}if (true) break;

case 6:
//C
this.state = 7;
RDebugUtils.currentLine=33947669;
 //BA.debugLineNum = 33947669;BA.debugLine="For i = 0 To c.RowCount - 1";
if (true) break;

case 7:
//for
this.state = 22;
step15 = 1;
limit15 = (int) (parent._c.getRowCount()-1);
_i = (int) (0) ;
this.state = 92;
if (true) break;

case 92:
//C
this.state = 22;
if ((step15 > 0 && _i <= limit15) || (step15 < 0 && _i >= limit15)) this.state = 9;
if (true) break;

case 93:
//C
this.state = 92;
_i = ((int)(0 + _i + step15)) ;
if (true) break;

case 9:
//C
this.state = 10;
RDebugUtils.currentLine=33947670;
 //BA.debugLineNum = 33947670;BA.debugLine="c.Position = i";
parent._c.setPosition(_i);
RDebugUtils.currentLine=33947673;
 //BA.debugLineNum = 33947673;BA.debugLine="LatitudRu = 0";
parent._latitudru = 0;
RDebugUtils.currentLine=33947674;
 //BA.debugLineNum = 33947674;BA.debugLine="Log(c.GetString(\"CAT_CL_CODIGO\")&\"      \"& c.G";
anywheresoftware.b4a.keywords.Common.LogImpl("533947674",parent._c.GetString("CAT_CL_CODIGO")+"      "+parent._c.GetString("CAT_CL_LAT"),0);
RDebugUtils.currentLine=33947675;
 //BA.debugLineNum = 33947675;BA.debugLine="If c.GetString(\"CAT_CL_LAT\") <> \"\" Then Latitu";
if (true) break;

case 10:
//if
this.state = 15;
if ((parent._c.GetString("CAT_CL_LAT")).equals("") == false) { 
this.state = 12;
;}if (true) break;

case 12:
//C
this.state = 15;
parent._latitudru = (double)(Double.parseDouble(parent._c.GetString("CAT_CL_LAT")));
if (true) break;

case 15:
//C
this.state = 16;
;
RDebugUtils.currentLine=33947676;
 //BA.debugLineNum = 33947676;BA.debugLine="LongitudRU = 0";
parent._longitudru = 0;
RDebugUtils.currentLine=33947677;
 //BA.debugLineNum = 33947677;BA.debugLine="If c.GetString(\"CAT_CL_LONG\") <> \"\" Then Longi";
if (true) break;

case 16:
//if
this.state = 21;
if ((parent._c.GetString("CAT_CL_LONG")).equals("") == false) { 
this.state = 18;
;}if (true) break;

case 18:
//C
this.state = 21;
parent._longitudru = (double)(Double.parseDouble(parent._c.GetString("CAT_CL_LONG")));
if (true) break;

case 21:
//C
this.state = 93;
;
RDebugUtils.currentLine=33947678;
 //BA.debugLineNum = 33947678;BA.debugLine="CODIGO=c.GetString(\"CAT_CL_CODIGO\")";
parent.mostCurrent._codigo = parent._c.GetString("CAT_CL_CODIGO");
RDebugUtils.currentLine=33947679;
 //BA.debugLineNum = 33947679;BA.debugLine="Tienda= c.GetString(\"CAT_CL_NOMBRE\")";
parent.mostCurrent._tienda = parent._c.GetString("CAT_CL_NOMBRE");
RDebugUtils.currentLine=33947680;
 //BA.debugLineNum = 33947680;BA.debugLine="MARK_AZUL = gmap.AddMarker2(LatitudRu, Longitu";
parent.mostCurrent._mark_azul = parent.mostCurrent._gmap.AddMarker2(parent._latitudru,parent._longitudru,parent.mostCurrent._codigo,parent.mostCurrent._gmap.HUE_BLUE);
RDebugUtils.currentLine=33947681;
 //BA.debugLineNum = 33947681;BA.debugLine="MARK_AZUL.Snippet = Tienda";
parent.mostCurrent._mark_azul.setSnippet(parent.mostCurrent._tienda);
 if (true) break;
if (true) break;

case 22:
//C
this.state = 23;
;
 if (true) break;

case 23:
//C
this.state = 24;
;
RDebugUtils.currentLine=33947684;
 //BA.debugLineNum = 33947684;BA.debugLine="c .Close";
parent._c.Close();
RDebugUtils.currentLine=33947687;
 //BA.debugLineNum = 33947687;BA.debugLine="If MARK_AZUL.IsInitialized Then LIST_AZUL.Add(MA";
if (true) break;

case 24:
//if
this.state = 29;
if (parent.mostCurrent._mark_azul.IsInitialized()) { 
this.state = 26;
;}if (true) break;

case 26:
//C
this.state = 29;
parent.mostCurrent._list_azul.Add((Object)(parent.mostCurrent._mark_azul.getObject()));
if (true) break;

case 29:
//C
this.state = 30;
;
 if (true) break;
;
RDebugUtils.currentLine=33947690;
 //BA.debugLineNum = 33947690;BA.debugLine="If verde = 1 Or todos = 1  Then";

case 30:
//if
this.state = 57;
if ((parent.mostCurrent._verde).equals(BA.NumberToString(1)) || (parent.mostCurrent._todos).equals(BA.NumberToString(1))) { 
this.state = 32;
}else {
this.state = 42;
}if (true) break;

case 32:
//C
this.state = 33;
RDebugUtils.currentLine=33947691;
 //BA.debugLineNum = 33947691;BA.debugLine="c2.IsInitialized";
parent._c2.IsInitialized();
RDebugUtils.currentLine=33947692;
 //BA.debugLineNum = 33947692;BA.debugLine="c2=skmt.ExecQuery(\"select CAT_CL_CODIGO, CAT_CL_";
parent._c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info where gestion = 2 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0  and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1 UNION select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info2 where gestion = 2 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0  and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")));
RDebugUtils.currentLine=33947693;
 //BA.debugLineNum = 33947693;BA.debugLine="Log($\"============== Resultados = ${c2.RowCount}";
anywheresoftware.b4a.keywords.Common.LogImpl("533947693",("============== Resultados = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(parent._c2.getRowCount()))+""),0);
RDebugUtils.currentLine=33947694;
 //BA.debugLineNum = 33947694;BA.debugLine="For i = 0 To c2.RowCount -1";
if (true) break;

case 33:
//for
this.state = 40;
step35 = 1;
limit35 = (int) (parent._c2.getRowCount()-1);
_i = (int) (0) ;
this.state = 94;
if (true) break;

case 94:
//C
this.state = 40;
if ((step35 > 0 && _i <= limit35) || (step35 < 0 && _i >= limit35)) this.state = 35;
if (true) break;

case 95:
//C
this.state = 94;
_i = ((int)(0 + _i + step35)) ;
if (true) break;

case 35:
//C
this.state = 36;
RDebugUtils.currentLine=33947695;
 //BA.debugLineNum = 33947695;BA.debugLine="c2.Position = i";
parent._c2.setPosition(_i);
RDebugUtils.currentLine=33947697;
 //BA.debugLineNum = 33947697;BA.debugLine="If IsNumber(c2.GetString(\"CAT_CL_LONG\")) Then";
if (true) break;

case 36:
//if
this.state = 39;
if (anywheresoftware.b4a.keywords.Common.IsNumber(parent._c2.GetString("CAT_CL_LONG"))) { 
this.state = 38;
}if (true) break;

case 38:
//C
this.state = 39;
RDebugUtils.currentLine=33947698;
 //BA.debugLineNum = 33947698;BA.debugLine="LongitudRU = c2.GetString(\"CAT_CL_LONG\")";
parent._longitudru = (double)(Double.parseDouble(parent._c2.GetString("CAT_CL_LONG")));
RDebugUtils.currentLine=33947699;
 //BA.debugLineNum = 33947699;BA.debugLine="LatitudRu = c2.GetString(\"CAT_CL_LAT\")";
parent._latitudru = (double)(Double.parseDouble(parent._c2.GetString("CAT_CL_LAT")));
RDebugUtils.currentLine=33947700;
 //BA.debugLineNum = 33947700;BA.debugLine="CODIGO=c2.GetString(\"CAT_CL_CODIGO\")";
parent.mostCurrent._codigo = parent._c2.GetString("CAT_CL_CODIGO");
RDebugUtils.currentLine=33947701;
 //BA.debugLineNum = 33947701;BA.debugLine="Tienda= c2.GetString(\"CAT_CL_NOMBRE\")";
parent.mostCurrent._tienda = parent._c2.GetString("CAT_CL_NOMBRE");
RDebugUtils.currentLine=33947702;
 //BA.debugLineNum = 33947702;BA.debugLine="MARK_VERDE = gmap.AddMarker2(LatitudRu, Longit";
parent.mostCurrent._mark_verde = parent.mostCurrent._gmap.AddMarker2(parent._latitudru,parent._longitudru,parent.mostCurrent._codigo,parent.mostCurrent._gmap.HUE_GREEN);
RDebugUtils.currentLine=33947703;
 //BA.debugLineNum = 33947703;BA.debugLine="MARK_VERDE.Snippet = Tienda";
parent.mostCurrent._mark_verde.setSnippet(parent.mostCurrent._tienda);
 if (true) break;

case 39:
//C
this.state = 95;
;
 if (true) break;
if (true) break;

case 40:
//C
this.state = 57;
;
 if (true) break;

case 42:
//C
this.state = 43;
RDebugUtils.currentLine=33947707;
 //BA.debugLineNum = 33947707;BA.debugLine="If verde = 1 Or todos = 1  Then";
if (true) break;

case 43:
//if
this.state = 56;
if ((parent.mostCurrent._verde).equals(BA.NumberToString(1)) || (parent.mostCurrent._todos).equals(BA.NumberToString(1))) { 
this.state = 45;
}if (true) break;

case 45:
//C
this.state = 46;
RDebugUtils.currentLine=33947708;
 //BA.debugLineNum = 33947708;BA.debugLine="c2.IsInitialized";
parent._c2.IsInitialized();
RDebugUtils.currentLine=33947709;
 //BA.debugLineNum = 33947709;BA.debugLine="c2=skmt.ExecQuery(\"select CAT_CL_CODIGO, CAT_CL";
parent._c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info where gestion = 2 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0  and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")));
RDebugUtils.currentLine=33947710;
 //BA.debugLineNum = 33947710;BA.debugLine="Log($\"============== Resultados = ${c2.RowCount";
anywheresoftware.b4a.keywords.Common.LogImpl("533947710",("============== Resultados = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(parent._c2.getRowCount()))+""),0);
RDebugUtils.currentLine=33947711;
 //BA.debugLineNum = 33947711;BA.debugLine="For i = 0 To c2.RowCount -1";
if (true) break;

case 46:
//for
this.state = 49;
step51 = 1;
limit51 = (int) (parent._c2.getRowCount()-1);
_i = (int) (0) ;
this.state = 96;
if (true) break;

case 96:
//C
this.state = 49;
if ((step51 > 0 && _i <= limit51) || (step51 < 0 && _i >= limit51)) this.state = 48;
if (true) break;

case 97:
//C
this.state = 96;
_i = ((int)(0 + _i + step51)) ;
if (true) break;

case 48:
//C
this.state = 97;
RDebugUtils.currentLine=33947712;
 //BA.debugLineNum = 33947712;BA.debugLine="c2.Position = i";
parent._c2.setPosition(_i);
RDebugUtils.currentLine=33947714;
 //BA.debugLineNum = 33947714;BA.debugLine="LongitudRU = c2.GetString(\"CAT_CL_LONG\")";
parent._longitudru = (double)(Double.parseDouble(parent._c2.GetString("CAT_CL_LONG")));
RDebugUtils.currentLine=33947715;
 //BA.debugLineNum = 33947715;BA.debugLine="LatitudRu = c2.GetString(\"CAT_CL_LAT\")";
parent._latitudru = (double)(Double.parseDouble(parent._c2.GetString("CAT_CL_LAT")));
RDebugUtils.currentLine=33947716;
 //BA.debugLineNum = 33947716;BA.debugLine="CODIGO=c2.GetString(\"CAT_CL_CODIGO\")";
parent.mostCurrent._codigo = parent._c2.GetString("CAT_CL_CODIGO");
RDebugUtils.currentLine=33947717;
 //BA.debugLineNum = 33947717;BA.debugLine="Tienda= c2.GetString(\"CAT_CL_NOMBRE\")";
parent.mostCurrent._tienda = parent._c2.GetString("CAT_CL_NOMBRE");
RDebugUtils.currentLine=33947718;
 //BA.debugLineNum = 33947718;BA.debugLine="MARK_VERDE = gmap.AddMarker2(LatitudRu, Longit";
parent.mostCurrent._mark_verde = parent.mostCurrent._gmap.AddMarker2(parent._latitudru,parent._longitudru,parent.mostCurrent._codigo,parent.mostCurrent._gmap.HUE_GREEN);
RDebugUtils.currentLine=33947719;
 //BA.debugLineNum = 33947719;BA.debugLine="MARK_VERDE.Snippet = Tienda";
parent.mostCurrent._mark_verde.setSnippet(parent.mostCurrent._tienda);
 if (true) break;
if (true) break;

case 49:
//C
this.state = 50;
;
RDebugUtils.currentLine=33947721;
 //BA.debugLineNum = 33947721;BA.debugLine="c2 .Close";
parent._c2.Close();
RDebugUtils.currentLine=33947722;
 //BA.debugLineNum = 33947722;BA.debugLine="If MARK_VERDE.IsInitialized Then LIST_VERDE.Add";
if (true) break;

case 50:
//if
this.state = 55;
if (parent.mostCurrent._mark_verde.IsInitialized()) { 
this.state = 52;
;}if (true) break;

case 52:
//C
this.state = 55;
parent.mostCurrent._list_verde.Add((Object)(parent.mostCurrent._mark_verde.getObject()));
if (true) break;

case 55:
//C
this.state = 56;
;
 if (true) break;

case 56:
//C
this.state = 57;
;
 if (true) break;
;
RDebugUtils.currentLine=33947727;
 //BA.debugLineNum = 33947727;BA.debugLine="If rojo = 1 Or todos = 1 Then";

case 57:
//if
this.state = 79;
if ((parent.mostCurrent._rojo).equals(BA.NumberToString(1)) || (parent.mostCurrent._todos).equals(BA.NumberToString(1))) { 
this.state = 59;
}else {
this.state = 65;
}if (true) break;

case 59:
//C
this.state = 60;
RDebugUtils.currentLine=33947728;
 //BA.debugLineNum = 33947728;BA.debugLine="c3.IsInitialized";
parent._c3.IsInitialized();
RDebugUtils.currentLine=33947729;
 //BA.debugLineNum = 33947729;BA.debugLine="c3=skmt.ExecQuery(\"select CAT_CL_CODIGO, CAT_CL_";
parent._c3 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info where gestion = 3 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0  and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")));
RDebugUtils.currentLine=33947730;
 //BA.debugLineNum = 33947730;BA.debugLine="Log($\"============== Resultados = ${c3.RowCount}";
anywheresoftware.b4a.keywords.Common.LogImpl("533947730",("============== Resultados = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(parent._c3.getRowCount()))+""),0);
RDebugUtils.currentLine=33947731;
 //BA.debugLineNum = 33947731;BA.debugLine="For i = 0 To c3.RowCount -1";
if (true) break;

case 60:
//for
this.state = 63;
step68 = 1;
limit68 = (int) (parent._c3.getRowCount()-1);
_i = (int) (0) ;
this.state = 98;
if (true) break;

case 98:
//C
this.state = 63;
if ((step68 > 0 && _i <= limit68) || (step68 < 0 && _i >= limit68)) this.state = 62;
if (true) break;

case 99:
//C
this.state = 98;
_i = ((int)(0 + _i + step68)) ;
if (true) break;

case 62:
//C
this.state = 99;
RDebugUtils.currentLine=33947732;
 //BA.debugLineNum = 33947732;BA.debugLine="c3.Position = i";
parent._c3.setPosition(_i);
RDebugUtils.currentLine=33947734;
 //BA.debugLineNum = 33947734;BA.debugLine="LongitudRU = c3.GetDouble(\"CAT_CL_LONG\")";
parent._longitudru = parent._c3.GetDouble("CAT_CL_LONG");
RDebugUtils.currentLine=33947735;
 //BA.debugLineNum = 33947735;BA.debugLine="LatitudRu = c3.GetDouble(\"CAT_CL_LAT\")";
parent._latitudru = parent._c3.GetDouble("CAT_CL_LAT");
RDebugUtils.currentLine=33947736;
 //BA.debugLineNum = 33947736;BA.debugLine="CODIGO = c3.GetString(\"CAT_CL_CODIGO\")";
parent.mostCurrent._codigo = parent._c3.GetString("CAT_CL_CODIGO");
RDebugUtils.currentLine=33947737;
 //BA.debugLineNum = 33947737;BA.debugLine="Tienda= c3.GetString(\"CAT_CL_NOMBRE\")";
parent.mostCurrent._tienda = parent._c3.GetString("CAT_CL_NOMBRE");
RDebugUtils.currentLine=33947738;
 //BA.debugLineNum = 33947738;BA.debugLine="MARK_ROJO = gmap.AddMarker2(LatitudRu, Longitud";
parent.mostCurrent._mark_rojo = parent.mostCurrent._gmap.AddMarker2(parent._latitudru,parent._longitudru,parent.mostCurrent._codigo,parent.mostCurrent._gmap.HUE_RED);
RDebugUtils.currentLine=33947739;
 //BA.debugLineNum = 33947739;BA.debugLine="MARK_ROJO.Snippet = Tienda";
parent.mostCurrent._mark_rojo.setSnippet(parent.mostCurrent._tienda);
 if (true) break;
if (true) break;

case 63:
//C
this.state = 79;
;
 if (true) break;

case 65:
//C
this.state = 66;
RDebugUtils.currentLine=33947742;
 //BA.debugLineNum = 33947742;BA.debugLine="If rojo = 1 Or  todos = 1  Then";
if (true) break;

case 66:
//if
this.state = 78;
if ((parent.mostCurrent._rojo).equals(BA.NumberToString(1)) || (parent.mostCurrent._todos).equals(BA.NumberToString(1))) { 
this.state = 68;
}if (true) break;

case 68:
//C
this.state = 69;
RDebugUtils.currentLine=33947743;
 //BA.debugLineNum = 33947743;BA.debugLine="c3.IsInitialized";
parent._c3.IsInitialized();
RDebugUtils.currentLine=33947744;
 //BA.debugLineNum = 33947744;BA.debugLine="c3=skmt.ExecQuery(\"select CAT_CL_CODIGO, CAT_CL";
parent._c3 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info where gestion = 3 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0  and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")));
RDebugUtils.currentLine=33947745;
 //BA.debugLineNum = 33947745;BA.debugLine="Log($\"============== Resultados = ${c3.RowCount";
anywheresoftware.b4a.keywords.Common.LogImpl("533947745",("============== Resultados = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(parent._c3.getRowCount()))+""),0);
RDebugUtils.currentLine=33947746;
 //BA.debugLineNum = 33947746;BA.debugLine="For i = 0 To c3.RowCount -1";
if (true) break;

case 69:
//for
this.state = 72;
step82 = 1;
limit82 = (int) (parent._c3.getRowCount()-1);
_i = (int) (0) ;
this.state = 100;
if (true) break;

case 100:
//C
this.state = 72;
if ((step82 > 0 && _i <= limit82) || (step82 < 0 && _i >= limit82)) this.state = 71;
if (true) break;

case 101:
//C
this.state = 100;
_i = ((int)(0 + _i + step82)) ;
if (true) break;

case 71:
//C
this.state = 101;
RDebugUtils.currentLine=33947747;
 //BA.debugLineNum = 33947747;BA.debugLine="c3.Position = i";
parent._c3.setPosition(_i);
RDebugUtils.currentLine=33947749;
 //BA.debugLineNum = 33947749;BA.debugLine="LongitudRU = c3.GetDouble(\"CAT_CL_LONG\")";
parent._longitudru = parent._c3.GetDouble("CAT_CL_LONG");
RDebugUtils.currentLine=33947750;
 //BA.debugLineNum = 33947750;BA.debugLine="LatitudRu = c3.GetDouble(\"CAT_CL_LAT\")";
parent._latitudru = parent._c3.GetDouble("CAT_CL_LAT");
RDebugUtils.currentLine=33947751;
 //BA.debugLineNum = 33947751;BA.debugLine="CODIGO = c3.GetString(\"CAT_CL_CODIGO\")";
parent.mostCurrent._codigo = parent._c3.GetString("CAT_CL_CODIGO");
RDebugUtils.currentLine=33947752;
 //BA.debugLineNum = 33947752;BA.debugLine="Tienda= c3.GetString(\"CAT_CL_NOMBRE\")";
parent.mostCurrent._tienda = parent._c3.GetString("CAT_CL_NOMBRE");
RDebugUtils.currentLine=33947753;
 //BA.debugLineNum = 33947753;BA.debugLine="MARK_ROJO = gmap.AddMarker2(LatitudRu, Longitu";
parent.mostCurrent._mark_rojo = parent.mostCurrent._gmap.AddMarker2(parent._latitudru,parent._longitudru,parent.mostCurrent._codigo,parent.mostCurrent._gmap.HUE_RED);
RDebugUtils.currentLine=33947754;
 //BA.debugLineNum = 33947754;BA.debugLine="MARK_ROJO.Snippet = Tienda";
parent.mostCurrent._mark_rojo.setSnippet(parent.mostCurrent._tienda);
 if (true) break;
if (true) break;
;
RDebugUtils.currentLine=33947756;
 //BA.debugLineNum = 33947756;BA.debugLine="If MARK_ROJO.IsInitialized Then LIST_ROJO.Add(M";

case 72:
//if
this.state = 77;
if (parent.mostCurrent._mark_rojo.IsInitialized()) { 
this.state = 74;
;}if (true) break;

case 74:
//C
this.state = 77;
parent.mostCurrent._list_rojo.Add((Object)(parent.mostCurrent._mark_rojo.getObject()));
if (true) break;

case 77:
//C
this.state = 78;
;
RDebugUtils.currentLine=33947757;
 //BA.debugLineNum = 33947757;BA.debugLine="c3.Close";
parent._c3.Close();
 if (true) break;

case 78:
//C
this.state = 79;
;
 if (true) break;

case 79:
//C
this.state = 80;
;
RDebugUtils.currentLine=33947766;
 //BA.debugLineNum = 33947766;BA.debugLine="Dim aa As CameraPosition";
_aa = new anywheresoftware.b4a.objects.MapFragmentWrapper.CameraPositionWrapper();
RDebugUtils.currentLine=33947767;
 //BA.debugLineNum = 33947767;BA.debugLine="aa.Initialize(LatitudRu,LongitudRU,15)''' RECOMEN";
_aa.Initialize(parent._latitudru,parent._longitudru,(float) (15));
RDebugUtils.currentLine=33947768;
 //BA.debugLineNum = 33947768;BA.debugLine="gmap.AnimateCamera(aa)";
parent.mostCurrent._gmap.AnimateCamera((com.google.android.gms.maps.model.CameraPosition)(_aa.getObject()));
RDebugUtils.currentLine=33947771;
 //BA.debugLineNum = 33947771;BA.debugLine="Dim OnInfoWindowClickListener1 As OnInfoWindowCli";
parent.mostCurrent._oninfowindowclicklistener1 = new uk.co.martinpearman.b4a.com.google.android.gms.maps.googlemap.OnInfoWindowClickListener();
RDebugUtils.currentLine=33947772;
 //BA.debugLineNum = 33947772;BA.debugLine="OnInfoWindowClickListener1.Initialize(\"OnInfoWind";
parent.mostCurrent._oninfowindowclicklistener1.Initialize(mostCurrent.activityBA,"OnInfoWindowClickListener1");
RDebugUtils.currentLine=33947773;
 //BA.debugLineNum = 33947773;BA.debugLine="GoogleMapEXTRA.SetOnInfoWindowClickListener(gmap,";
parent.mostCurrent._googlemapextra.SetOnInfoWindowClickListener((com.google.android.gms.maps.GoogleMap)(parent.mostCurrent._gmap.getObject()),(com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener)(parent.mostCurrent._oninfowindowclicklistener1.getObject()));
RDebugUtils.currentLine=33947777;
 //BA.debugLineNum = 33947777;BA.debugLine="Dim pol As Cursor = Starter.skmt.ExecQuery(\"SELEC";
_pol = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_pol = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent.mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT LAT, LONG FROM POLIGONO")));
RDebugUtils.currentLine=33947778;
 //BA.debugLineNum = 33947778;BA.debugLine="If pol.RowCount > 0 Then";
if (true) break;

case 80:
//if
this.state = 90;
if (_pol.getRowCount()>0) { 
this.state = 82;
}if (true) break;

case 82:
//C
this.state = 83;
RDebugUtils.currentLine=33947780;
 //BA.debugLineNum = 33947780;BA.debugLine="For poli = 0 To pol.RowCount -1";
if (true) break;

case 83:
//for
this.state = 86;
step103 = 1;
limit103 = (int) (_pol.getRowCount()-1);
_poli = (int) (0) ;
this.state = 102;
if (true) break;

case 102:
//C
this.state = 86;
if ((step103 > 0 && _poli <= limit103) || (step103 < 0 && _poli >= limit103)) this.state = 85;
if (true) break;

case 103:
//C
this.state = 102;
_poli = ((int)(0 + _poli + step103)) ;
if (true) break;

case 85:
//C
this.state = 103;
RDebugUtils.currentLine=33947781;
 //BA.debugLineNum = 33947781;BA.debugLine="pol.Position = poli";
_pol.setPosition(_poli);
RDebugUtils.currentLine=33947782;
 //BA.debugLineNum = 33947782;BA.debugLine="Dim coords As LatLng";
_coords = new anywheresoftware.b4a.objects.MapFragmentWrapper.LatLngWrapper();
RDebugUtils.currentLine=33947783;
 //BA.debugLineNum = 33947783;BA.debugLine="coords.Initialize(pol.GetString(\"LAT\"), pol.Get";
_coords.Initialize((double)(Double.parseDouble(_pol.GetString("LAT"))),(double)(Double.parseDouble(_pol.GetString("LONG"))));
RDebugUtils.currentLine=33947784;
 //BA.debugLineNum = 33947784;BA.debugLine="lista_punta.Add(coords)";
parent.mostCurrent._lista_punta.Add((Object)(_coords.getObject()));
 if (true) break;
if (true) break;
;
RDebugUtils.currentLine=33947827;
 //BA.debugLineNum = 33947827;BA.debugLine="If lista_punta.Size >= 4 Then";

case 86:
//if
this.state = 89;
if (parent.mostCurrent._lista_punta.getSize()>=4) { 
this.state = 88;
}if (true) break;

case 88:
//C
this.state = 89;
RDebugUtils.currentLine=33947828;
 //BA.debugLineNum = 33947828;BA.debugLine="DrawPolygon(lista_punta)";
_drawpolygon(parent.mostCurrent._lista_punta);
 if (true) break;

case 89:
//C
this.state = 90;
;
 if (true) break;

case 90:
//C
this.state = -1;
;
RDebugUtils.currentLine=33947831;
 //BA.debugLineNum = 33947831;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static String  _b_rojo_click() throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "b_rojo_click", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "b_rojo_click", null));}
RDebugUtils.currentLine=34340864;
 //BA.debugLineNum = 34340864;BA.debugLine="Sub B_ROJO_Click";
RDebugUtils.currentLine=34340865;
 //BA.debugLineNum = 34340865;BA.debugLine="rojo = 1";
mostCurrent._rojo = BA.NumberToString(1);
RDebugUtils.currentLine=34340866;
 //BA.debugLineNum = 34340866;BA.debugLine="verde = 0";
mostCurrent._verde = BA.NumberToString(0);
RDebugUtils.currentLine=34340867;
 //BA.debugLineNum = 34340867;BA.debugLine="azul = 0";
mostCurrent._azul = BA.NumberToString(0);
RDebugUtils.currentLine=34340868;
 //BA.debugLineNum = 34340868;BA.debugLine="todos = 0";
mostCurrent._todos = BA.NumberToString(0);
RDebugUtils.currentLine=34340869;
 //BA.debugLineNum = 34340869;BA.debugLine="gmap.Clear";
mostCurrent._gmap.Clear();
RDebugUtils.currentLine=34340871;
 //BA.debugLineNum = 34340871;BA.debugLine="MapFragment1_Ready";
_mapfragment1_ready();
RDebugUtils.currentLine=34340873;
 //BA.debugLineNum = 34340873;BA.debugLine="End Sub";
return "";
}
public static String  _b_todos_click() throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "b_todos_click", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "b_todos_click", null));}
RDebugUtils.currentLine=34209792;
 //BA.debugLineNum = 34209792;BA.debugLine="Sub B_TODOS_Click";
RDebugUtils.currentLine=34209793;
 //BA.debugLineNum = 34209793;BA.debugLine="todos  =1";
mostCurrent._todos = BA.NumberToString(1);
RDebugUtils.currentLine=34209794;
 //BA.debugLineNum = 34209794;BA.debugLine="verde = 0";
mostCurrent._verde = BA.NumberToString(0);
RDebugUtils.currentLine=34209795;
 //BA.debugLineNum = 34209795;BA.debugLine="azul = 0";
mostCurrent._azul = BA.NumberToString(0);
RDebugUtils.currentLine=34209796;
 //BA.debugLineNum = 34209796;BA.debugLine="rojo = 0";
mostCurrent._rojo = BA.NumberToString(0);
RDebugUtils.currentLine=34209798;
 //BA.debugLineNum = 34209798;BA.debugLine="MapFragment1_Ready";
_mapfragment1_ready();
RDebugUtils.currentLine=34209800;
 //BA.debugLineNum = 34209800;BA.debugLine="End Sub";
return "";
}
public static String  _b_verde_click() throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "b_verde_click", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "b_verde_click", null));}
RDebugUtils.currentLine=34275328;
 //BA.debugLineNum = 34275328;BA.debugLine="Sub B_VERDE_Click";
RDebugUtils.currentLine=34275329;
 //BA.debugLineNum = 34275329;BA.debugLine="verde = 1";
mostCurrent._verde = BA.NumberToString(1);
RDebugUtils.currentLine=34275330;
 //BA.debugLineNum = 34275330;BA.debugLine="azul = 0";
mostCurrent._azul = BA.NumberToString(0);
RDebugUtils.currentLine=34275331;
 //BA.debugLineNum = 34275331;BA.debugLine="rojo = 0";
mostCurrent._rojo = BA.NumberToString(0);
RDebugUtils.currentLine=34275332;
 //BA.debugLineNum = 34275332;BA.debugLine="todos = 0";
mostCurrent._todos = BA.NumberToString(0);
RDebugUtils.currentLine=34275333;
 //BA.debugLineNum = 34275333;BA.debugLine="gmap.Clear";
mostCurrent._gmap.Clear();
RDebugUtils.currentLine=34275334;
 //BA.debugLineNum = 34275334;BA.debugLine="MapFragment1_Ready";
_mapfragment1_ready();
RDebugUtils.currentLine=34275336;
 //BA.debugLineNum = 34275336;BA.debugLine="End Sub";
return "";
}
public static String  _drawpolygon(anywheresoftware.b4a.objects.collections.List _pointlist) throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "drawpolygon", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "drawpolygon", new Object[] {_pointlist}));}
uk.co.martinpearman.b4a.googlemapsextras.GoogleMapsExtras _googlemapsextras1 = null;
uk.co.martinpearman.b4a.com.google.android.gms.maps.model.PolygonOptions _polygonoptions1 = null;
uk.co.martinpearman.b4a.com.google.android.gms.maps.model.Polygon _pg = null;
RDebugUtils.currentLine=34537472;
 //BA.debugLineNum = 34537472;BA.debugLine="Sub DrawPolygon (PointList As List)";
RDebugUtils.currentLine=34537473;
 //BA.debugLineNum = 34537473;BA.debugLine="Dim GoogleMapsExtras1 As GoogleMapsExtras";
_googlemapsextras1 = new uk.co.martinpearman.b4a.googlemapsextras.GoogleMapsExtras();
RDebugUtils.currentLine=34537474;
 //BA.debugLineNum = 34537474;BA.debugLine="Dim polygonoptions1 As PolygonOptions";
_polygonoptions1 = new uk.co.martinpearman.b4a.com.google.android.gms.maps.model.PolygonOptions();
RDebugUtils.currentLine=34537475;
 //BA.debugLineNum = 34537475;BA.debugLine="polygonoptions1.Initialize";
_polygonoptions1.Initialize();
RDebugUtils.currentLine=34537476;
 //BA.debugLineNum = 34537476;BA.debugLine="polygonoptions1.FillColor=Colors.ARGB(100,255,0,0";
_polygonoptions1.setFillColor(anywheresoftware.b4a.keywords.Common.Colors.ARGB((int) (100),(int) (255),(int) (0),(int) (0)));
RDebugUtils.currentLine=34537477;
 //BA.debugLineNum = 34537477;BA.debugLine="polygonoptions1.AddPoints(PointList)";
_polygonoptions1.AddPoints(_pointlist);
RDebugUtils.currentLine=34537478;
 //BA.debugLineNum = 34537478;BA.debugLine="polygonoptions1.StrokeColor=Colors.DarkGray";
_polygonoptions1.setStrokeColor(anywheresoftware.b4a.keywords.Common.Colors.DarkGray);
RDebugUtils.currentLine=34537479;
 //BA.debugLineNum = 34537479;BA.debugLine="polygonoptions1.StrokeWidth=1";
_polygonoptions1.setStrokeWidth((float) (1));
RDebugUtils.currentLine=34537480;
 //BA.debugLineNum = 34537480;BA.debugLine="Dim pg As Polygon = GoogleMapsExtras1.AddPolygon(";
_pg = new uk.co.martinpearman.b4a.com.google.android.gms.maps.model.Polygon();
_pg = _googlemapsextras1.AddPolygon((com.google.android.gms.maps.GoogleMap)(mostCurrent._gmap.getObject()),(com.google.android.gms.maps.model.PolygonOptions)(_polygonoptions1.getObject()));
RDebugUtils.currentLine=34537481;
 //BA.debugLineNum = 34537481;BA.debugLine="End Sub";
return "";
}
public static String  _gps_locationchanged(anywheresoftware.b4a.gps.LocationWrapper _parametro) throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "gps_locationchanged", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "gps_locationchanged", new Object[] {_parametro}));}
RDebugUtils.currentLine=34078720;
 //BA.debugLineNum = 34078720;BA.debugLine="Sub GPS_LocationChanged (Parametro As Location)";
RDebugUtils.currentLine=34078721;
 //BA.debugLineNum = 34078721;BA.debugLine="MARK_CEDIS.IsInitialized";
mostCurrent._mark_cedis.IsInitialized();
RDebugUtils.currentLine=34078739;
 //BA.debugLineNum = 34078739;BA.debugLine="End Sub";
return "";
}
public static String  _mapfragment1_click(anywheresoftware.b4a.objects.MapFragmentWrapper.LatLngWrapper _point) throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "mapfragment1_click", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "mapfragment1_click", new Object[] {_point}));}
RDebugUtils.currentLine=34471936;
 //BA.debugLineNum = 34471936;BA.debugLine="Sub MapFragment1_Click (Point As LatLng)";
RDebugUtils.currentLine=34471938;
 //BA.debugLineNum = 34471938;BA.debugLine="Log(Point.Latitude)";
anywheresoftware.b4a.keywords.Common.LogImpl("534471938",BA.NumberToString(_point.getLatitude()),0);
RDebugUtils.currentLine=34471939;
 //BA.debugLineNum = 34471939;BA.debugLine="Log(Point.Longitude)";
anywheresoftware.b4a.keywords.Common.LogImpl("534471939",BA.NumberToString(_point.getLongitude()),0);
RDebugUtils.currentLine=34471941;
 //BA.debugLineNum = 34471941;BA.debugLine="End Sub";
return "";
}
public static String  _mapfragment1_longclick(anywheresoftware.b4a.objects.MapFragmentWrapper.LatLngWrapper _mpoint) throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "mapfragment1_longclick", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "mapfragment1_longclick", new Object[] {_mpoint}));}
boolean _dentro = false;
RDebugUtils.currentLine=34668544;
 //BA.debugLineNum = 34668544;BA.debugLine="Sub MapFragment1_LongClick (mPoint As LatLng)";
RDebugUtils.currentLine=34668546;
 //BA.debugLineNum = 34668546;BA.debugLine="If lista_punta.Size > 0 Then";
if (mostCurrent._lista_punta.getSize()>0) { 
RDebugUtils.currentLine=34668547;
 //BA.debugLineNum = 34668547;BA.debugLine="Dim dentro As Boolean = PointInPolygon(mPoint, l";
_dentro = _pointinpolygon(_mpoint,mostCurrent._lista_punta);
RDebugUtils.currentLine=34668549;
 //BA.debugLineNum = 34668549;BA.debugLine="If dentro Then";
if (_dentro) { 
RDebugUtils.currentLine=34668550;
 //BA.debugLineNum = 34668550;BA.debugLine="ToastMessageShow(\"El punto está DENTRO del polí";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("El punto está DENTRO del polígono"),anywheresoftware.b4a.keywords.Common.True);
 }else {
RDebugUtils.currentLine=34668552;
 //BA.debugLineNum = 34668552;BA.debugLine="ToastMessageShow(\"El punto está FUERA del políg";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("El punto está FUERA del polígono"),anywheresoftware.b4a.keywords.Common.True);
 };
 };
RDebugUtils.currentLine=34668557;
 //BA.debugLineNum = 34668557;BA.debugLine="gmap.AddMarker3(mPoint.Latitude, mPoint.Longitude";
mostCurrent._gmap.AddMarker3(_mpoint.getLatitude(),_mpoint.getLongitude(),"MicroArea ",(android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.LoadBitmap(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"marker-amarillo.png").getObject())).setInfoWindowShown(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=34668558;
 //BA.debugLineNum = 34668558;BA.debugLine="lista_punta2.Add(mPoint)";
mostCurrent._lista_punta2.Add((Object)(_mpoint.getObject()));
RDebugUtils.currentLine=34668560;
 //BA.debugLineNum = 34668560;BA.debugLine="If lista_punta2.Size = 6 Then";
if (mostCurrent._lista_punta2.getSize()==6) { 
RDebugUtils.currentLine=34668561;
 //BA.debugLineNum = 34668561;BA.debugLine="DrawPolygon(lista_punta2)";
_drawpolygon(mostCurrent._lista_punta2);
 };
RDebugUtils.currentLine=34668563;
 //BA.debugLineNum = 34668563;BA.debugLine="End Sub";
return "";
}
public static boolean  _pointinpolygon(anywheresoftware.b4a.objects.MapFragmentWrapper.LatLngWrapper _point,anywheresoftware.b4a.objects.collections.List _polygon) throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "pointinpolygon", false))
	 {return ((Boolean) Debug.delegate(mostCurrent.activityBA, "pointinpolygon", new Object[] {_point,_polygon}));}
double _x = 0;
double _y = 0;
boolean _inside = false;
int _i = 0;
int _j = 0;
anywheresoftware.b4a.objects.MapFragmentWrapper.LatLngWrapper _p1_1 = null;
anywheresoftware.b4a.objects.MapFragmentWrapper.LatLngWrapper _p2_1 = null;
double _xi = 0;
double _yi = 0;
double _xj = 0;
double _yj = 0;
boolean _intersect = false;
RDebugUtils.currentLine=34603008;
 //BA.debugLineNum = 34603008;BA.debugLine="Sub PointInPolygon(point As LatLng, polygon As Lis";
RDebugUtils.currentLine=34603009;
 //BA.debugLineNum = 34603009;BA.debugLine="Dim x As Double = point.Longitude";
_x = _point.getLongitude();
RDebugUtils.currentLine=34603010;
 //BA.debugLineNum = 34603010;BA.debugLine="Dim y As Double = point.Latitude";
_y = _point.getLatitude();
RDebugUtils.currentLine=34603012;
 //BA.debugLineNum = 34603012;BA.debugLine="Dim inside As Boolean = False";
_inside = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=34603013;
 //BA.debugLineNum = 34603013;BA.debugLine="For i = 0 To polygon.Size - 1";
{
final int step4 = 1;
final int limit4 = (int) (_polygon.getSize()-1);
_i = (int) (0) ;
for (;_i <= limit4 ;_i = _i + step4 ) {
RDebugUtils.currentLine=34603014;
 //BA.debugLineNum = 34603014;BA.debugLine="Dim j As Int = (i + 1) Mod polygon.Size";
_j = (int) ((_i+1)%_polygon.getSize());
RDebugUtils.currentLine=34603015;
 //BA.debugLineNum = 34603015;BA.debugLine="Dim p1_1 As LatLng = polygon.Get(i)";
_p1_1 = new anywheresoftware.b4a.objects.MapFragmentWrapper.LatLngWrapper();
_p1_1 = (anywheresoftware.b4a.objects.MapFragmentWrapper.LatLngWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.MapFragmentWrapper.LatLngWrapper(), (com.google.android.gms.maps.model.LatLng)(_polygon.Get(_i)));
RDebugUtils.currentLine=34603016;
 //BA.debugLineNum = 34603016;BA.debugLine="Dim p2_1 As LatLng = polygon.Get(j)";
_p2_1 = new anywheresoftware.b4a.objects.MapFragmentWrapper.LatLngWrapper();
_p2_1 = (anywheresoftware.b4a.objects.MapFragmentWrapper.LatLngWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.MapFragmentWrapper.LatLngWrapper(), (com.google.android.gms.maps.model.LatLng)(_polygon.Get(_j)));
RDebugUtils.currentLine=34603018;
 //BA.debugLineNum = 34603018;BA.debugLine="Dim xi As Double = p1_1.Longitude";
_xi = _p1_1.getLongitude();
RDebugUtils.currentLine=34603019;
 //BA.debugLineNum = 34603019;BA.debugLine="Dim yi As Double = p1_1.Latitude";
_yi = _p1_1.getLatitude();
RDebugUtils.currentLine=34603020;
 //BA.debugLineNum = 34603020;BA.debugLine="Dim xj As Double = p2_1.Longitude";
_xj = _p2_1.getLongitude();
RDebugUtils.currentLine=34603021;
 //BA.debugLineNum = 34603021;BA.debugLine="Dim yj As Double = p2_1.Latitude";
_yj = _p2_1.getLatitude();
RDebugUtils.currentLine=34603023;
 //BA.debugLineNum = 34603023;BA.debugLine="Dim intersect As Boolean = ((yi > y) <> (yj > y)";
_intersect = ((_yi>_y)!=(_yj>_y)) && (_x<(_xj-_xi)*(_y-_yi)/(double)(_yj-_yi)+_xi);
RDebugUtils.currentLine=34603024;
 //BA.debugLineNum = 34603024;BA.debugLine="If intersect Then";
if (_intersect) { 
RDebugUtils.currentLine=34603025;
 //BA.debugLineNum = 34603025;BA.debugLine="inside = Not(inside)";
_inside = anywheresoftware.b4a.keywords.Common.Not(_inside);
 };
 }
};
RDebugUtils.currentLine=34603029;
 //BA.debugLineNum = 34603029;BA.debugLine="Return inside";
if (true) return _inside;
RDebugUtils.currentLine=34603032;
 //BA.debugLineNum = 34603032;BA.debugLine="End Sub";
return false;
}
public static String  _oninfowindowclicklistener1_click(anywheresoftware.b4a.objects.MapFragmentWrapper.MarkerWrapper _marker1) throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "oninfowindowclicklistener1_click", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "oninfowindowclicklistener1_click", new Object[] {_marker1}));}
RDebugUtils.currentLine=34013184;
 //BA.debugLineNum = 34013184;BA.debugLine="Sub OnInfoWindowClickListener1_click(Marker1 As Ma";
RDebugUtils.currentLine=34013185;
 //BA.debugLineNum = 34013185;BA.debugLine="skmt.ExecNonQuery(\"delete from CUENTAA\")";
_skmt.ExecNonQuery("delete from CUENTAA");
RDebugUtils.currentLine=34013186;
 //BA.debugLineNum = 34013186;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO CUENTAA VALUES (?";
_skmt.ExecNonQuery2("INSERT INTO CUENTAA VALUES (?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_marker1.getTitle())}));
RDebugUtils.currentLine=34013187;
 //BA.debugLineNum = 34013187;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
RDebugUtils.currentLine=34013188;
 //BA.debugLineNum = 34013188;BA.debugLine="Starter.pre_viejo = Subs.traeTotalClientepreventa";
mostCurrent._starter._pre_viejo /*float*/  = (float) (mostCurrent._subs._traetotalclientepreventaparacredito /*double*/ (mostCurrent.activityBA));
RDebugUtils.currentLine=34013189;
 //BA.debugLineNum = 34013189;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
mostCurrent._b4xpages._showpage /*String*/ (mostCurrent.activityBA,"Cliente");
RDebugUtils.currentLine=34013190;
 //BA.debugLineNum = 34013190;BA.debugLine="End Sub";
return "";
}
}