package gunav2.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, "gunav2.keymon.com.mx", "gunav2.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, "gunav2.keymon.com.mx", "gunav2.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, "gunav2.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 b4a.example.dateutils _dateutils = null;
public gunav2.keymon.com.mx.main _main = null;
public gunav2.keymon.com.mx.starter _starter = null;
public gunav2.keymon.com.mx.subs _subs = null;
public gunav2.keymon.com.mx.appupdater _appupdater = null;
public gunav2.keymon.com.mx.tracker _tracker = null;
public gunav2.keymon.com.mx.firebasemessaging _firebasemessaging = null;
public gunav2.keymon.com.mx.newinst2 _newinst2 = null;
public gunav2.keymon.com.mx.b4xpages _b4xpages = null;
public gunav2.keymon.com.mx.b4xcollections _b4xcollections = null;
public gunav2.keymon.com.mx.httputils2service _httputils2service = null;
public gunav2.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public static 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=93257728;
 //BA.debugLineNum = 93257728;BA.debugLine="Sub GPS_LocationChanged (Parametro As Location)";
RDebugUtils.currentLine=93257729;
 //BA.debugLineNum = 93257729;BA.debugLine="MARK_CEDIS.IsInitialized";
mostCurrent._mark_cedis.IsInitialized();
RDebugUtils.currentLine=93257747;
 //BA.debugLineNum = 93257747;BA.debugLine="End Sub";
return "";
}
public static String  _activity_create(boolean _firsttime) throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "activity_create", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "activity_create", new Object[] {_firsttime}));}
RDebugUtils.currentLine=93061120;
 //BA.debugLineNum = 93061120;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
RDebugUtils.currentLine=93061121;
 //BA.debugLineNum = 93061121;BA.debugLine="Activity.LoadLayout(\"MAPA_RUTAS\")";
mostCurrent._activity.LoadLayout("MAPA_RUTAS",mostCurrent.activityBA);
RDebugUtils.currentLine=93061125;
 //BA.debugLineNum = 93061125;BA.debugLine="ruta = File.DirInternal";
_ruta = anywheresoftware.b4a.keywords.Common.File.getDirInternal();
RDebugUtils.currentLine=93061127;
 //BA.debugLineNum = 93061127;BA.debugLine="If File.Exists(ruta, \"kmt.db\") = False Then";
if (anywheresoftware.b4a.keywords.Common.File.Exists(_ruta,"kmt.db")==anywheresoftware.b4a.keywords.Common.False) { 
RDebugUtils.currentLine=93061128;
 //BA.debugLineNum = 93061128;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",_ruta,"kmt.db");
 };
RDebugUtils.currentLine=93061130;
 //BA.debugLineNum = 93061130;BA.debugLine="skmt.Initialize(ruta,\"kmt.db\", True)";
_skmt.Initialize(_ruta,"kmt.db",anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=93061132;
 //BA.debugLineNum = 93061132;BA.debugLine="If(FirstTime) Then";
if ((_firsttime)) { 
RDebugUtils.currentLine=93061133;
 //BA.debugLineNum = 93061133;BA.debugLine="GPS.Initialize(\"GPS\")";
_gps.Initialize("GPS");
 };
RDebugUtils.currentLine=93061136;
 //BA.debugLineNum = 93061136;BA.debugLine="If MapFragment1.IsGooglePlayServicesAvailable = F";
if (mostCurrent._mapfragment1.IsGooglePlayServicesAvailable(mostCurrent.activityBA)==anywheresoftware.b4a.keywords.Common.False) { 
RDebugUtils.currentLine=93061137;
 //BA.debugLineNum = 93061137;BA.debugLine="ToastMessageShow(\"Please install Google Play Ser";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Please install Google Play Services."),anywheresoftware.b4a.keywords.Common.True);
 };
RDebugUtils.currentLine=93061148;
 //BA.debugLineNum = 93061148;BA.debugLine="MARK_AZUL.IsInitialized";
mostCurrent._mark_azul.IsInitialized();
RDebugUtils.currentLine=93061149;
 //BA.debugLineNum = 93061149;BA.debugLine="MARK_ROJO.IsInitialized";
mostCurrent._mark_rojo.IsInitialized();
RDebugUtils.currentLine=93061150;
 //BA.debugLineNum = 93061150;BA.debugLine="MARK_VERDE.IsInitialized";
mostCurrent._mark_verde.IsInitialized();
RDebugUtils.currentLine=93061152;
 //BA.debugLineNum = 93061152;BA.debugLine="LIST_AZUL.Initialize";
mostCurrent._list_azul.Initialize();
RDebugUtils.currentLine=93061153;
 //BA.debugLineNum = 93061153;BA.debugLine="LIST_ROJO.Initialize";
mostCurrent._list_rojo.Initialize();
RDebugUtils.currentLine=93061154;
 //BA.debugLineNum = 93061154;BA.debugLine="LIST_VERDE.Initialize";
mostCurrent._list_verde.Initialize();
RDebugUtils.currentLine=93061156;
 //BA.debugLineNum = 93061156;BA.debugLine="verde = 0";
mostCurrent._verde = BA.NumberToString(0);
RDebugUtils.currentLine=93061157;
 //BA.debugLineNum = 93061157;BA.debugLine="azul = 0";
mostCurrent._azul = BA.NumberToString(0);
RDebugUtils.currentLine=93061158;
 //BA.debugLineNum = 93061158;BA.debugLine="rojo = 0";
mostCurrent._rojo = BA.NumberToString(0);
RDebugUtils.currentLine=93061159;
 //BA.debugLineNum = 93061159;BA.debugLine="todos = 1";
mostCurrent._todos = BA.NumberToString(1);
RDebugUtils.currentLine=93061160;
 //BA.debugLineNum = 93061160;BA.debugLine="c=skmt.ExecQuery2(\"select count(*) AS CUANTOS fro";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("select count(*) AS CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",new String[]{"SEMANA"})));
RDebugUtils.currentLine=93061161;
 //BA.debugLineNum = 93061161;BA.debugLine="c.Position =0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=93061162;
 //BA.debugLineNum = 93061162;BA.debugLine="SEMANA = c.GetString(\"CUANTOS\")";
mostCurrent._semana = _c.GetString("CUANTOS");
RDebugUtils.currentLine=93061163;
 //BA.debugLineNum = 93061163;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=93061165;
 //BA.debugLineNum = 93061165;BA.debugLine="If SEMANA > 0 Then";
if ((double)(Double.parseDouble(mostCurrent._semana))>0) { 
RDebugUtils.currentLine=93061166;
 //BA.debugLineNum = 93061166;BA.debugLine="c=skmt.ExecQuery2(\"select CAT_VA_VALOR from CAT_";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",new String[]{"SEMANA"})));
RDebugUtils.currentLine=93061167;
 //BA.debugLineNum = 93061167;BA.debugLine="c.Position =0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=93061168;
 //BA.debugLineNum = 93061168;BA.debugLine="SEMANA = c.GetString(\"CAT_VA_VALOR\")";
mostCurrent._semana = _c.GetString("CAT_VA_VALOR");
RDebugUtils.currentLine=93061169;
 //BA.debugLineNum = 93061169;BA.debugLine="c.Close";
_c.Close();
 };
RDebugUtils.currentLine=93061173;
 //BA.debugLineNum = 93061173;BA.debugLine="End Sub";
return "";
}
public static String  _activity_pause(boolean _userclosed) throws Exception{
RDebugUtils.currentModule="mapa_rutas";
RDebugUtils.currentLine=93388800;
 //BA.debugLineNum = 93388800;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
RDebugUtils.currentLine=93388801;
 //BA.debugLineNum = 93388801;BA.debugLine="GPS.Stop";
_gps.Stop();
RDebugUtils.currentLine=93388802;
 //BA.debugLineNum = 93388802;BA.debugLine="End Sub";
return "";
}
public static String  _activity_resume() throws Exception{
RDebugUtils.currentModule="mapa_rutas";
if (Debug.shouldDelegate(mostCurrent.activityBA, "activity_resume", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "activity_resume", null));}
RDebugUtils.currentLine=93323264;
 //BA.debugLineNum = 93323264;BA.debugLine="Sub Activity_Resume";
RDebugUtils.currentLine=93323266;
 //BA.debugLineNum = 93323266;BA.debugLine="If GPS.GPSEnabled = False Then";
if (_gps.getGPSEnabled()==anywheresoftware.b4a.keywords.Common.False) { 
RDebugUtils.currentLine=93323267;
 //BA.debugLineNum = 93323267;BA.debugLine="ToastMessageShow(\"Debe Activar el GPS del Equipo";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Debe Activar el GPS del Equipo."),anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=93323268;
 //BA.debugLineNum = 93323268;BA.debugLine="StartActivity(GPS.LocationSettingsIntent)";
anywheresoftware.b4a.keywords.Common.StartActivity(processBA,(Object)(_gps.getLocationSettingsIntent()));
 }else {
RDebugUtils.currentLine=93323270;
 //BA.debugLineNum = 93323270;BA.debugLine="GPS.Start(0, 0)";
_gps.Start(processBA,(long) (0),(float) (0));
 };
RDebugUtils.currentLine=93323272;
 //BA.debugLineNum = 93323272;BA.debugLine="End Sub";
return "";
}
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=93650944;
 //BA.debugLineNum = 93650944;BA.debugLine="Sub B_AZUL_Click";
RDebugUtils.currentLine=93650945;
 //BA.debugLineNum = 93650945;BA.debugLine="azul = 1";
mostCurrent._azul = BA.NumberToString(1);
RDebugUtils.currentLine=93650946;
 //BA.debugLineNum = 93650946;BA.debugLine="verde = 0";
mostCurrent._verde = BA.NumberToString(0);
RDebugUtils.currentLine=93650947;
 //BA.debugLineNum = 93650947;BA.debugLine="rojo = 0";
mostCurrent._rojo = BA.NumberToString(0);
RDebugUtils.currentLine=93650948;
 //BA.debugLineNum = 93650948;BA.debugLine="todos = 0";
mostCurrent._todos = BA.NumberToString(0);
RDebugUtils.currentLine=93650949;
 //BA.debugLineNum = 93650949;BA.debugLine="gmap.Clear";
mostCurrent._gmap.Clear();
RDebugUtils.currentLine=93650951;
 //BA.debugLineNum = 93650951;BA.debugLine="MapFragment1_Ready";
_mapfragment1_ready();
RDebugUtils.currentLine=93650953;
 //BA.debugLineNum = 93650953;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(gunav2.keymon.com.mx.mapa_rutas parent) {
this.parent = parent;
}
gunav2.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;
int step15;
int limit15;
int step33;
int limit33;
int step46;
int limit46;
int step62;
int limit62;
int step75;
int limit75;

@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=93126657;
 //BA.debugLineNum = 93126657;BA.debugLine="Log(\"ENTRANDO MapFragment1_Ready\")";
anywheresoftware.b4a.keywords.Common.LogImpl("093126657","ENTRANDO MapFragment1_Ready",0);
RDebugUtils.currentLine=93126658;
 //BA.debugLineNum = 93126658;BA.debugLine="gmap = MapFragment1.GetMap";
parent.mostCurrent._gmap = parent.mostCurrent._mapfragment1.GetMap();
RDebugUtils.currentLine=93126659;
 //BA.debugLineNum = 93126659;BA.debugLine="gmap.IsInitialized";
parent.mostCurrent._gmap.IsInitialized();
RDebugUtils.currentLine=93126663;
 //BA.debugLineNum = 93126663;BA.debugLine="rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCA";
parent._rp.CheckAndRequest(processBA,parent._rp.PERMISSION_ACCESS_FINE_LOCATION);
RDebugUtils.currentLine=93126664;
 //BA.debugLineNum = 93126664;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 = 76;
return;
case 76:
//C
this.state = 1;
_permission = (String) result[0];
_result = (Boolean) result[1];
;
RDebugUtils.currentLine=93126665;
 //BA.debugLineNum = 93126665;BA.debugLine="gmap.MyLocationEnabled = Result";
parent.mostCurrent._gmap.setMyLocationEnabled(_result);
RDebugUtils.currentLine=93126667;
 //BA.debugLineNum = 93126667;BA.debugLine="Dim JavaMapsObject As JavaObject";
_javamapsobject = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=93126668;
 //BA.debugLineNum = 93126668;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=93126669;
 //BA.debugLineNum = 93126669;BA.debugLine="JavaMapsObject.RunMethod(\"setMapToolbarEnabled\",";
_javamapsobject.RunMethod("setMapToolbarEnabled",new Object[]{(Object)(anywheresoftware.b4a.keywords.Common.True)});
RDebugUtils.currentLine=93126671;
 //BA.debugLineNum = 93126671;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=93126672;
 //BA.debugLineNum = 93126672;BA.debugLine="c.IsInitialized";
parent._c.IsInitialized();
RDebugUtils.currentLine=93126673;
 //BA.debugLineNum = 93126673;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_info3 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 <> ' ' ")));
RDebugUtils.currentLine=93126674;
 //BA.debugLineNum = 93126674;BA.debugLine="skmt.Initialize(ruta,\"kmt.db\", True)";
parent._skmt.Initialize(parent._ruta,"kmt.db",anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=93126675;
 //BA.debugLineNum = 93126675;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=93126676;
 //BA.debugLineNum = 93126676;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 = 77;
if (true) break;

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

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

case 9:
//C
this.state = 10;
RDebugUtils.currentLine=93126677;
 //BA.debugLineNum = 93126677;BA.debugLine="c.Position = i";
parent._c.setPosition(_i);
RDebugUtils.currentLine=93126679;
 //BA.debugLineNum = 93126679;BA.debugLine="LatitudRu = 0";
parent._latitudru = 0;
RDebugUtils.currentLine=93126680;
 //BA.debugLineNum = 93126680;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=93126681;
 //BA.debugLineNum = 93126681;BA.debugLine="LongitudRU = 0";
parent._longitudru = 0;
RDebugUtils.currentLine=93126682;
 //BA.debugLineNum = 93126682;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 = 78;
;
RDebugUtils.currentLine=93126683;
 //BA.debugLineNum = 93126683;BA.debugLine="CODIGO=c.GetString(\"CAT_CL_CODIGO\")";
parent.mostCurrent._codigo = parent._c.GetString("CAT_CL_CODIGO");
RDebugUtils.currentLine=93126684;
 //BA.debugLineNum = 93126684;BA.debugLine="Tienda= c.GetString(\"CAT_CL_NOMBRE\")";
parent.mostCurrent._tienda = parent._c.GetString("CAT_CL_NOMBRE");
RDebugUtils.currentLine=93126685;
 //BA.debugLineNum = 93126685;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=93126686;
 //BA.debugLineNum = 93126686;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=93126689;
 //BA.debugLineNum = 93126689;BA.debugLine="c .Close";
parent._c.Close();
RDebugUtils.currentLine=93126692;
 //BA.debugLineNum = 93126692;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=93126695;
 //BA.debugLineNum = 93126695;BA.debugLine="If verde =1 Or todos = 1  Then";

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

case 32:
//C
this.state = 33;
RDebugUtils.currentLine=93126696;
 //BA.debugLineNum = 93126696;BA.debugLine="c2.IsInitialized";
parent._c2.IsInitialized();
RDebugUtils.currentLine=93126697;
 //BA.debugLineNum = 93126697;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_info3 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")));
RDebugUtils.currentLine=93126698;
 //BA.debugLineNum = 93126698;BA.debugLine="For i = 0 To c2.RowCount -1";
if (true) break;

case 33:
//for
this.state = 36;
step33 = 1;
limit33 = (int) (parent._c2.getRowCount()-1);
_i = (int) (0) ;
this.state = 79;
if (true) break;

case 79:
//C
this.state = 36;
if ((step33 > 0 && _i <= limit33) || (step33 < 0 && _i >= limit33)) this.state = 35;
if (true) break;

case 80:
//C
this.state = 79;
_i = ((int)(0 + _i + step33)) ;
if (true) break;

case 35:
//C
this.state = 80;
RDebugUtils.currentLine=93126699;
 //BA.debugLineNum = 93126699;BA.debugLine="c2.Position = i";
parent._c2.setPosition(_i);
RDebugUtils.currentLine=93126700;
 //BA.debugLineNum = 93126700;BA.debugLine="LongitudRU = c2.GetString(\"CAT_CL_LONG\")";
parent._longitudru = (double)(Double.parseDouble(parent._c2.GetString("CAT_CL_LONG")));
RDebugUtils.currentLine=93126701;
 //BA.debugLineNum = 93126701;BA.debugLine="LatitudRu = c2.GetString(\"CAT_CL_LAT\")";
parent._latitudru = (double)(Double.parseDouble(parent._c2.GetString("CAT_CL_LAT")));
RDebugUtils.currentLine=93126702;
 //BA.debugLineNum = 93126702;BA.debugLine="CODIGO=c2.GetString(\"CAT_CL_CODIGO\")";
parent.mostCurrent._codigo = parent._c2.GetString("CAT_CL_CODIGO");
RDebugUtils.currentLine=93126703;
 //BA.debugLineNum = 93126703;BA.debugLine="Tienda= c2.GetString(\"CAT_CL_NOMBRE\")";
parent.mostCurrent._tienda = parent._c2.GetString("CAT_CL_NOMBRE");
RDebugUtils.currentLine=93126704;
 //BA.debugLineNum = 93126704;BA.debugLine="MARK_VERDE = gmap.AddMarker2(LatitudRu, Longitu";
parent.mostCurrent._mark_verde = parent.mostCurrent._gmap.AddMarker2(parent._latitudru,parent._longitudru,parent.mostCurrent._codigo,parent.mostCurrent._gmap.HUE_GREEN);
RDebugUtils.currentLine=93126705;
 //BA.debugLineNum = 93126705;BA.debugLine="MARK_VERDE.Snippet = Tienda";
parent.mostCurrent._mark_verde.setSnippet(parent.mostCurrent._tienda);
 if (true) break;
if (true) break;

case 36:
//C
this.state = 53;
;
 if (true) break;

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

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

case 41:
//C
this.state = 42;
RDebugUtils.currentLine=93126709;
 //BA.debugLineNum = 93126709;BA.debugLine="c2.IsInitialized";
parent._c2.IsInitialized();
RDebugUtils.currentLine=93126710;
 //BA.debugLineNum = 93126710;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_info3 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")));
RDebugUtils.currentLine=93126711;
 //BA.debugLineNum = 93126711;BA.debugLine="For i = 0 To c2.RowCount -1";
if (true) break;

case 42:
//for
this.state = 45;
step46 = 1;
limit46 = (int) (parent._c2.getRowCount()-1);
_i = (int) (0) ;
this.state = 81;
if (true) break;

case 81:
//C
this.state = 45;
if ((step46 > 0 && _i <= limit46) || (step46 < 0 && _i >= limit46)) this.state = 44;
if (true) break;

case 82:
//C
this.state = 81;
_i = ((int)(0 + _i + step46)) ;
if (true) break;

case 44:
//C
this.state = 82;
RDebugUtils.currentLine=93126712;
 //BA.debugLineNum = 93126712;BA.debugLine="c2.Position = i";
parent._c2.setPosition(_i);
RDebugUtils.currentLine=93126713;
 //BA.debugLineNum = 93126713;BA.debugLine="LongitudRU = c2.GetString(\"CAT_CL_LONG\")";
parent._longitudru = (double)(Double.parseDouble(parent._c2.GetString("CAT_CL_LONG")));
RDebugUtils.currentLine=93126714;
 //BA.debugLineNum = 93126714;BA.debugLine="LatitudRu = c2.GetString(\"CAT_CL_LAT\")";
parent._latitudru = (double)(Double.parseDouble(parent._c2.GetString("CAT_CL_LAT")));
RDebugUtils.currentLine=93126715;
 //BA.debugLineNum = 93126715;BA.debugLine="CODIGO=c2.GetString(\"CAT_CL_CODIGO\")";
parent.mostCurrent._codigo = parent._c2.GetString("CAT_CL_CODIGO");
RDebugUtils.currentLine=93126716;
 //BA.debugLineNum = 93126716;BA.debugLine="Tienda= c2.GetString(\"CAT_CL_NOMBRE\")";
parent.mostCurrent._tienda = parent._c2.GetString("CAT_CL_NOMBRE");
RDebugUtils.currentLine=93126717;
 //BA.debugLineNum = 93126717;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=93126718;
 //BA.debugLineNum = 93126718;BA.debugLine="MARK_VERDE.Snippet = Tienda";
parent.mostCurrent._mark_verde.setSnippet(parent.mostCurrent._tienda);
 if (true) break;
if (true) break;

case 45:
//C
this.state = 46;
;
RDebugUtils.currentLine=93126720;
 //BA.debugLineNum = 93126720;BA.debugLine="c2 .Close";
parent._c2.Close();
RDebugUtils.currentLine=93126721;
 //BA.debugLineNum = 93126721;BA.debugLine="If MARK_VERDE.IsInitialized Then LIST_VERDE.Add";
if (true) break;

case 46:
//if
this.state = 51;
if (parent.mostCurrent._mark_verde.IsInitialized()) { 
this.state = 48;
;}if (true) break;

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

case 51:
//C
this.state = 52;
;
 if (true) break;

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

case 53:
//if
this.state = 75;
if ((parent.mostCurrent._rojo).equals(BA.NumberToString(1)) || (parent.mostCurrent._todos).equals(BA.NumberToString(1))) { 
this.state = 55;
}else {
this.state = 61;
}if (true) break;

case 55:
//C
this.state = 56;
RDebugUtils.currentLine=93126727;
 //BA.debugLineNum = 93126727;BA.debugLine="c3.IsInitialized";
parent._c3.IsInitialized();
RDebugUtils.currentLine=93126728;
 //BA.debugLineNum = 93126728;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_info3 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")));
RDebugUtils.currentLine=93126729;
 //BA.debugLineNum = 93126729;BA.debugLine="For i = 0 To c3.RowCount -1";
if (true) break;

case 56:
//for
this.state = 59;
step62 = 1;
limit62 = (int) (parent._c3.getRowCount()-1);
_i = (int) (0) ;
this.state = 83;
if (true) break;

case 83:
//C
this.state = 59;
if ((step62 > 0 && _i <= limit62) || (step62 < 0 && _i >= limit62)) this.state = 58;
if (true) break;

case 84:
//C
this.state = 83;
_i = ((int)(0 + _i + step62)) ;
if (true) break;

case 58:
//C
this.state = 84;
RDebugUtils.currentLine=93126730;
 //BA.debugLineNum = 93126730;BA.debugLine="c3.Position = i";
parent._c3.setPosition(_i);
RDebugUtils.currentLine=93126731;
 //BA.debugLineNum = 93126731;BA.debugLine="LongitudRU = c3.GetDouble(\"CAT_CL_LONG\")";
parent._longitudru = parent._c3.GetDouble("CAT_CL_LONG");
RDebugUtils.currentLine=93126732;
 //BA.debugLineNum = 93126732;BA.debugLine="LatitudRu = c3.GetDouble(\"CAT_CL_LAT\")";
parent._latitudru = parent._c3.GetDouble("CAT_CL_LAT");
RDebugUtils.currentLine=93126733;
 //BA.debugLineNum = 93126733;BA.debugLine="CODIGO=c3.GetString(\"CAT_CL_CODIGO\")";
parent.mostCurrent._codigo = parent._c3.GetString("CAT_CL_CODIGO");
RDebugUtils.currentLine=93126734;
 //BA.debugLineNum = 93126734;BA.debugLine="Tienda= c3.GetString(\"CAT_CL_NOMBRE\")";
parent.mostCurrent._tienda = parent._c3.GetString("CAT_CL_NOMBRE");
RDebugUtils.currentLine=93126735;
 //BA.debugLineNum = 93126735;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=93126736;
 //BA.debugLineNum = 93126736;BA.debugLine="MARK_ROJO.Snippet = Tienda";
parent.mostCurrent._mark_rojo.setSnippet(parent.mostCurrent._tienda);
 if (true) break;
if (true) break;

case 59:
//C
this.state = 75;
;
 if (true) break;

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

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

case 64:
//C
this.state = 65;
RDebugUtils.currentLine=93126740;
 //BA.debugLineNum = 93126740;BA.debugLine="c3.IsInitialized";
parent._c3.IsInitialized();
RDebugUtils.currentLine=93126741;
 //BA.debugLineNum = 93126741;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_info3 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")));
RDebugUtils.currentLine=93126742;
 //BA.debugLineNum = 93126742;BA.debugLine="For i = 0 To c3.RowCount -1";
if (true) break;

case 65:
//for
this.state = 68;
step75 = 1;
limit75 = (int) (parent._c3.getRowCount()-1);
_i = (int) (0) ;
this.state = 85;
if (true) break;

case 85:
//C
this.state = 68;
if ((step75 > 0 && _i <= limit75) || (step75 < 0 && _i >= limit75)) this.state = 67;
if (true) break;

case 86:
//C
this.state = 85;
_i = ((int)(0 + _i + step75)) ;
if (true) break;

case 67:
//C
this.state = 86;
RDebugUtils.currentLine=93126743;
 //BA.debugLineNum = 93126743;BA.debugLine="c3.Position = i";
parent._c3.setPosition(_i);
RDebugUtils.currentLine=93126744;
 //BA.debugLineNum = 93126744;BA.debugLine="LongitudRU = c3.GetDouble(\"CAT_CL_LONG\")";
parent._longitudru = parent._c3.GetDouble("CAT_CL_LONG");
RDebugUtils.currentLine=93126745;
 //BA.debugLineNum = 93126745;BA.debugLine="LatitudRu = c3.GetDouble(\"CAT_CL_LAT\")";
parent._latitudru = parent._c3.GetDouble("CAT_CL_LAT");
RDebugUtils.currentLine=93126746;
 //BA.debugLineNum = 93126746;BA.debugLine="CODIGO=c3.GetString(\"CAT_CL_CODIGO\")";
parent.mostCurrent._codigo = parent._c3.GetString("CAT_CL_CODIGO");
RDebugUtils.currentLine=93126747;
 //BA.debugLineNum = 93126747;BA.debugLine="Tienda= c3.GetString(\"CAT_CL_NOMBRE\")";
parent.mostCurrent._tienda = parent._c3.GetString("CAT_CL_NOMBRE");
RDebugUtils.currentLine=93126748;
 //BA.debugLineNum = 93126748;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=93126749;
 //BA.debugLineNum = 93126749;BA.debugLine="MARK_ROJO.Snippet = Tienda";
parent.mostCurrent._mark_rojo.setSnippet(parent.mostCurrent._tienda);
 if (true) break;
if (true) break;
;
RDebugUtils.currentLine=93126751;
 //BA.debugLineNum = 93126751;BA.debugLine="If MARK_ROJO.IsInitialized Then LIST_ROJO.Add(M";

case 68:
//if
this.state = 73;
if (parent.mostCurrent._mark_rojo.IsInitialized()) { 
this.state = 70;
;}if (true) break;

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

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

case 74:
//C
this.state = 75;
;
 if (true) break;

case 75:
//C
this.state = -1;
;
RDebugUtils.currentLine=93126761;
 //BA.debugLineNum = 93126761;BA.debugLine="Dim aa As CameraPosition";
_aa = new anywheresoftware.b4a.objects.MapFragmentWrapper.CameraPositionWrapper();
RDebugUtils.currentLine=93126762;
 //BA.debugLineNum = 93126762;BA.debugLine="aa.Initialize(LatitudRu,LongitudRU,15)''' RECOMEN";
_aa.Initialize(parent._latitudru,parent._longitudru,(float) (15));
RDebugUtils.currentLine=93126763;
 //BA.debugLineNum = 93126763;BA.debugLine="gmap.AnimateCamera(aa)";
parent.mostCurrent._gmap.AnimateCamera((com.google.android.gms.maps.model.CameraPosition)(_aa.getObject()));
RDebugUtils.currentLine=93126766;
 //BA.debugLineNum = 93126766;BA.debugLine="Dim OnInfoWindowClickListener1 As OnInfoWindowCli";
parent.mostCurrent._oninfowindowclicklistener1 = new uk.co.martinpearman.b4a.com.google.android.gms.maps.googlemap.OnInfoWindowClickListener();
RDebugUtils.currentLine=93126767;
 //BA.debugLineNum = 93126767;BA.debugLine="OnInfoWindowClickListener1.Initialize(\"OnInfoWind";
parent.mostCurrent._oninfowindowclicklistener1.Initialize(mostCurrent.activityBA,"OnInfoWindowClickListener1");
RDebugUtils.currentLine=93126768;
 //BA.debugLineNum = 93126768;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=93126770;
 //BA.debugLineNum = 93126770;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=93585408;
 //BA.debugLineNum = 93585408;BA.debugLine="Sub B_ROJO_Click";
RDebugUtils.currentLine=93585409;
 //BA.debugLineNum = 93585409;BA.debugLine="rojo = 1";
mostCurrent._rojo = BA.NumberToString(1);
RDebugUtils.currentLine=93585410;
 //BA.debugLineNum = 93585410;BA.debugLine="verde = 0";
mostCurrent._verde = BA.NumberToString(0);
RDebugUtils.currentLine=93585411;
 //BA.debugLineNum = 93585411;BA.debugLine="azul = 0";
mostCurrent._azul = BA.NumberToString(0);
RDebugUtils.currentLine=93585412;
 //BA.debugLineNum = 93585412;BA.debugLine="todos = 0";
mostCurrent._todos = BA.NumberToString(0);
RDebugUtils.currentLine=93585413;
 //BA.debugLineNum = 93585413;BA.debugLine="gmap.Clear";
mostCurrent._gmap.Clear();
RDebugUtils.currentLine=93585415;
 //BA.debugLineNum = 93585415;BA.debugLine="MapFragment1_Ready";
_mapfragment1_ready();
RDebugUtils.currentLine=93585417;
 //BA.debugLineNum = 93585417;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=93454336;
 //BA.debugLineNum = 93454336;BA.debugLine="Sub B_TODOS_Click";
RDebugUtils.currentLine=93454337;
 //BA.debugLineNum = 93454337;BA.debugLine="todos  =1";
mostCurrent._todos = BA.NumberToString(1);
RDebugUtils.currentLine=93454338;
 //BA.debugLineNum = 93454338;BA.debugLine="verde = 0";
mostCurrent._verde = BA.NumberToString(0);
RDebugUtils.currentLine=93454339;
 //BA.debugLineNum = 93454339;BA.debugLine="azul = 0";
mostCurrent._azul = BA.NumberToString(0);
RDebugUtils.currentLine=93454340;
 //BA.debugLineNum = 93454340;BA.debugLine="rojo = 0";
mostCurrent._rojo = BA.NumberToString(0);
RDebugUtils.currentLine=93454342;
 //BA.debugLineNum = 93454342;BA.debugLine="MapFragment1_Ready";
_mapfragment1_ready();
RDebugUtils.currentLine=93454344;
 //BA.debugLineNum = 93454344;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=93519872;
 //BA.debugLineNum = 93519872;BA.debugLine="Sub B_VERDE_Click";
RDebugUtils.currentLine=93519873;
 //BA.debugLineNum = 93519873;BA.debugLine="verde = 1";
mostCurrent._verde = BA.NumberToString(1);
RDebugUtils.currentLine=93519874;
 //BA.debugLineNum = 93519874;BA.debugLine="azul = 0";
mostCurrent._azul = BA.NumberToString(0);
RDebugUtils.currentLine=93519875;
 //BA.debugLineNum = 93519875;BA.debugLine="rojo = 0";
mostCurrent._rojo = BA.NumberToString(0);
RDebugUtils.currentLine=93519876;
 //BA.debugLineNum = 93519876;BA.debugLine="todos = 0";
mostCurrent._todos = BA.NumberToString(0);
RDebugUtils.currentLine=93519877;
 //BA.debugLineNum = 93519877;BA.debugLine="gmap.Clear";
mostCurrent._gmap.Clear();
RDebugUtils.currentLine=93519878;
 //BA.debugLineNum = 93519878;BA.debugLine="MapFragment1_Ready";
_mapfragment1_ready();
RDebugUtils.currentLine=93519880;
 //BA.debugLineNum = 93519880;BA.debugLine="End Sub";
return "";
}
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=93192192;
 //BA.debugLineNum = 93192192;BA.debugLine="Sub OnInfoWindowClickListener1_click(Marker1 As Ma";
RDebugUtils.currentLine=93192193;
 //BA.debugLineNum = 93192193;BA.debugLine="skmt.ExecNonQuery(\"delete from CUENTAA\")";
_skmt.ExecNonQuery("delete from CUENTAA");
RDebugUtils.currentLine=93192194;
 //BA.debugLineNum = 93192194;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=93192195;
 //BA.debugLineNum = 93192195;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
RDebugUtils.currentLine=93192196;
 //BA.debugLineNum = 93192196;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
mostCurrent._b4xpages._showpage /*String*/ (mostCurrent.activityBA,"Cliente");
RDebugUtils.currentLine=93192197;
 //BA.debugLineNum = 93192197;BA.debugLine="End Sub";
return "";
}
}