package reparto_mazapa.keymon.lat;


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_cliente extends Activity implements B4AActivity{
	public static mapa_cliente 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 BA(this.getApplicationContext(), null, null, "reparto_mazapa.keymon.lat", "reparto_mazapa.keymon.lat.mapa_cliente");
			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_cliente).");
				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, "reparto_mazapa.keymon.lat", "reparto_mazapa.keymon.lat.mapa_cliente");
        
        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, "reparto_mazapa.keymon.lat.mapa_cliente", processBA, activityBA, _activity, anywheresoftware.b4a.keywords.Common.Density, mostCurrent);
			_activity.reinitializeForShell(activityBA, "activity");
		}
        initializeProcessGlobals();		
        initializeGlobals();
        
        BA.LogInfo("** Activity (mapa_cliente) 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_cliente) 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_cliente.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_cliente) Pause, UserClosed = " + activityBA.activity.isFinishing() + " **");
        else
            BA.LogInfo("** Activity (mapa_cliente) 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_cliente mc = mostCurrent;
			if (mc == null || mc != activity.get())
				return;
			processBA.setActivityPaused(false);
            BA.LogInfo("** Activity (mapa_cliente) 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 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 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 anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public static String _latmarker = "";
public static String _longmarker = "";
public anywheresoftware.b4a.objects.LabelWrapper _l_long = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_lat = null;
public static String _nombre_tienda = "";
public anywheresoftware.b4a.objects.PanelWrapper _p_principal = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_regresar = null;
public b4a.example.dateutils _dateutils = null;
public reparto_mazapa.keymon.lat.main _main = null;
public reparto_mazapa.keymon.lat.appupdater _appupdater = null;
public reparto_mazapa.keymon.lat.tracker _tracker = null;
public reparto_mazapa.keymon.lat.starter _starter = null;
public reparto_mazapa.keymon.lat.subs _subs = null;
public reparto_mazapa.keymon.lat.firebasemessaging _firebasemessaging = null;
public reparto_mazapa.keymon.lat.foto _foto = null;
public reparto_mazapa.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_mazapa.keymon.lat.newinst2 _newinst2 = null;
public reparto_mazapa.keymon.lat.b4xpages _b4xpages = null;
public reparto_mazapa.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_mazapa.keymon.lat.httputils2service _httputils2service = null;
public reparto_mazapa.keymon.lat.xuiviewsutils _xuiviewsutils = null;

public static void initializeProcessGlobals() {
             try {
                Class.forName(BA.applicationContext.getPackageName() + ".main").getMethod("initializeProcessGlobals").invoke(null, null);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
}
public static String  _activity_create(boolean _firsttime) throws Exception{
 //BA.debugLineNum = 34;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
 //BA.debugLineNum = 35;BA.debugLine="Activity.LoadLayout(\"mapa_cliente\")";
mostCurrent._activity.LoadLayout("mapa_cliente",mostCurrent.activityBA);
 //BA.debugLineNum = 36;BA.debugLine="If MapFragment1.IsGooglePlayServicesAvailable = F";
if (mostCurrent._mapfragment1.IsGooglePlayServicesAvailable(mostCurrent.activityBA)==anywheresoftware.b4a.keywords.Common.False) { 
 //BA.debugLineNum = 37;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);
 };
 //BA.debugLineNum = 39;BA.debugLine="End Sub";
return "";
}
public static String  _activity_pause(boolean _userclosed) throws Exception{
 //BA.debugLineNum = 96;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
 //BA.debugLineNum = 97;BA.debugLine="GPS.Stop";
_gps.Stop();
 //BA.debugLineNum = 98;BA.debugLine="End Sub";
return "";
}
public static String  _activity_resume() throws Exception{
 //BA.debugLineNum = 80;BA.debugLine="Sub Activity_Resume";
 //BA.debugLineNum = 81;BA.debugLine="Subs.centraBoton(b_regresar, Activity.Width)";
mostCurrent._subs._centraboton /*String*/ (mostCurrent.activityBA,mostCurrent._b_regresar,mostCurrent._activity.getWidth());
 //BA.debugLineNum = 82;BA.debugLine="GPS.Initialize(\"GPS\")";
_gps.Initialize("GPS");
 //BA.debugLineNum = 83;BA.debugLine="If GPS.GPSEnabled = False Then";
if (_gps.getGPSEnabled()==anywheresoftware.b4a.keywords.Common.False) { 
 //BA.debugLineNum = 84;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);
 //BA.debugLineNum = 85;BA.debugLine="StartActivity(GPS.LocationSettingsIntent)";
anywheresoftware.b4a.keywords.Common.StartActivity(processBA,(Object)(_gps.getLocationSettingsIntent()));
 }else {
 //BA.debugLineNum = 87;BA.debugLine="GPS.Start(0, 0)";
_gps.Start(processBA,(long) (0),(float) (0));
 };
 //BA.debugLineNum = 89;BA.debugLine="Subs.centraPanel(p_principal, Activity.Width)";
mostCurrent._subs._centrapanel /*String*/ (mostCurrent.activityBA,mostCurrent._p_principal,mostCurrent._activity.getWidth());
 //BA.debugLineNum = 90;BA.debugLine="p_principal.Height = Activity.Height	* 0.95";
mostCurrent._p_principal.setHeight((int) (mostCurrent._activity.getHeight()*0.95));
 //BA.debugLineNum = 91;BA.debugLine="latmarker = B4XPages.MainPage.cliente.LATITUD";
mostCurrent._latmarker = mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (mostCurrent.activityBA)._cliente /*reparto_mazapa.keymon.lat.c_cliente*/ ._latitud /*String*/ ;
 //BA.debugLineNum = 92;BA.debugLine="longmarker =  B4XPages.MainPage.cliente.LONGITUD";
mostCurrent._longmarker = mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (mostCurrent.activityBA)._cliente /*reparto_mazapa.keymon.lat.c_cliente*/ ._longitud /*String*/ ;
 //BA.debugLineNum = 93;BA.debugLine="NOMBRE_TIENDA = B4XPages.MainPage.cliente.NOMBRE";
mostCurrent._nombre_tienda = mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (mostCurrent.activityBA)._cliente /*reparto_mazapa.keymon.lat.c_cliente*/ ._nombre /*String*/ ;
 //BA.debugLineNum = 94;BA.debugLine="End Sub";
return "";
}
public static String  _b_regresar_click() throws Exception{
 //BA.debugLineNum = 105;BA.debugLine="Private Sub b_regresar_Click";
 //BA.debugLineNum = 106;BA.debugLine="Log(\"Pressed\")";
anywheresoftware.b4a.keywords.Common.LogImpl("372351745","Pressed",0);
 //BA.debugLineNum = 107;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
 //BA.debugLineNum = 108;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
mostCurrent._b4xpages._showpage /*String*/ (mostCurrent.activityBA,"Cliente");
 //BA.debugLineNum = 109;BA.debugLine="End Sub";
return "";
}
public static String  _globals() throws Exception{
 //BA.debugLineNum = 14;BA.debugLine="Sub Globals";
 //BA.debugLineNum = 15;BA.debugLine="Private gmap As GoogleMap";
mostCurrent._gmap = new anywheresoftware.b4a.objects.MapFragmentWrapper.GoogleMapWrapper();
 //BA.debugLineNum = 16;BA.debugLine="Private MapFragment1 As MapFragment";
mostCurrent._mapfragment1 = new anywheresoftware.b4a.objects.MapFragmentWrapper();
 //BA.debugLineNum = 17;BA.debugLine="Dim Latitud As Double = 0";
_latitud = 0;
 //BA.debugLineNum = 18;BA.debugLine="Dim Longitud As Double = 0";
_longitud = 0;
 //BA.debugLineNum = 19;BA.debugLine="Dim Lat2 As Double = 0";
_lat2 = 0;
 //BA.debugLineNum = 20;BA.debugLine="Dim Lon2 As Double = 0";
_lon2 = 0;
 //BA.debugLineNum = 21;BA.debugLine="Dim p1, p2 As Location";
mostCurrent._p1 = new anywheresoftware.b4a.gps.LocationWrapper();
mostCurrent._p2 = new anywheresoftware.b4a.gps.LocationWrapper();
 //BA.debugLineNum = 22;BA.debugLine="Dim Distance As Float";
_distance = 0f;
 //BA.debugLineNum = 23;BA.debugLine="Dim boton1 As Button";
mostCurrent._boton1 = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 24;BA.debugLine="Dim c As Cursor";
mostCurrent._c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 25;BA.debugLine="Dim latmarker As String";
mostCurrent._latmarker = "";
 //BA.debugLineNum = 26;BA.debugLine="Dim longmarker As String";
mostCurrent._longmarker = "";
 //BA.debugLineNum = 27;BA.debugLine="Private l_long As Label";
mostCurrent._l_long = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 28;BA.debugLine="Private l_lat As Label";
mostCurrent._l_lat = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 29;BA.debugLine="Private NOMBRE_TIENDA As String";
mostCurrent._nombre_tienda = "";
 //BA.debugLineNum = 30;BA.debugLine="Private p_principal As Panel";
mostCurrent._p_principal = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 31;BA.debugLine="Private b_regresar As Button";
mostCurrent._b_regresar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 32;BA.debugLine="End Sub";
return "";
}
public static String  _gps_locationchanged(anywheresoftware.b4a.gps.LocationWrapper _parametro) throws Exception{
 //BA.debugLineNum = 59;BA.debugLine="Sub GPS_LocationChanged (Parametro As Location)";
 //BA.debugLineNum = 78;BA.debugLine="End Sub";
return "";
}
public static void  _mapfragment1_ready() throws Exception{
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(reparto_mazapa.keymon.lat.mapa_cliente parent) {
this.parent = parent;
}
reparto_mazapa.keymon.lat.mapa_cliente parent;
String _permission = "";
boolean _result = false;
anywheresoftware.b4j.object.JavaObject _javamapsobject = null;
anywheresoftware.b4a.objects.MapFragmentWrapper.MarkerWrapper _marcador1 = null;
anywheresoftware.b4a.objects.MapFragmentWrapper.CameraPositionWrapper _aa = null;

@Override
public void resume(BA ba, Object[] result) throws Exception{

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

case 0:
//C
this.state = -1;
 //BA.debugLineNum = 42;BA.debugLine="gmap = MapFragment1.GetMap";
parent.mostCurrent._gmap = parent.mostCurrent._mapfragment1.GetMap();
 //BA.debugLineNum = 44;BA.debugLine="rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCA";
parent._rp.CheckAndRequest(processBA,parent._rp.PERMISSION_ACCESS_FINE_LOCATION);
 //BA.debugLineNum = 45;BA.debugLine="Wait For Activity_PermissionResult (Permission As";
anywheresoftware.b4a.keywords.Common.WaitFor("activity_permissionresult", processBA, this, null);
this.state = 1;
return;
case 1:
//C
this.state = -1;
_permission = (String) result[0];
_result = (Boolean) result[1];
;
 //BA.debugLineNum = 46;BA.debugLine="gmap.MyLocationEnabled = Result";
parent.mostCurrent._gmap.setMyLocationEnabled(_result);
 //BA.debugLineNum = 48;BA.debugLine="Dim JavaMapsObject As JavaObject";
_javamapsobject = new anywheresoftware.b4j.object.JavaObject();
 //BA.debugLineNum = 49;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()));
 //BA.debugLineNum = 50;BA.debugLine="JavaMapsObject.RunMethod(\"setMapToolbarEnabled\",";
_javamapsobject.RunMethod("setMapToolbarEnabled",new Object[]{(Object)(anywheresoftware.b4a.keywords.Common.True)});
 //BA.debugLineNum = 51;BA.debugLine="Dim marcador1 As Marker = gmap.AddMarker (latmark";
_marcador1 = new anywheresoftware.b4a.objects.MapFragmentWrapper.MarkerWrapper();
_marcador1 = parent.mostCurrent._gmap.AddMarker((double)(Double.parseDouble(parent.mostCurrent._latmarker)),(double)(Double.parseDouble(parent.mostCurrent._longmarker)),"TIENDA");
 //BA.debugLineNum = 52;BA.debugLine="marcador1.Snippet = B4XPages.MainPage.cliente.NOM";
_marcador1.setSnippet(parent.mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (mostCurrent.activityBA)._cliente /*reparto_mazapa.keymon.lat.c_cliente*/ ._nombre /*String*/ );
 //BA.debugLineNum = 54;BA.debugLine="Dim aa As CameraPosition";
_aa = new anywheresoftware.b4a.objects.MapFragmentWrapper.CameraPositionWrapper();
 //BA.debugLineNum = 55;BA.debugLine="aa.Initialize(latmarker,longmarker,15)''' RECOMEN";
_aa.Initialize((double)(Double.parseDouble(parent.mostCurrent._latmarker)),(double)(Double.parseDouble(parent.mostCurrent._longmarker)),(float) (15));
 //BA.debugLineNum = 56;BA.debugLine="gmap.AnimateCamera(aa)";
parent.mostCurrent._gmap.AnimateCamera((com.google.android.gms.maps.model.CameraPosition)(_aa.getObject()));
 //BA.debugLineNum = 57;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static void  _activity_permissionresult(String _permission,boolean _result) throws Exception{
}
public static String  _process_globals() throws Exception{
 //BA.debugLineNum = 7;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 8;BA.debugLine="Dim GPS As GPS";
_gps = new anywheresoftware.b4a.gps.GPS();
 //BA.debugLineNum = 9;BA.debugLine="Dim rp As RuntimePermissions";
_rp = new anywheresoftware.b4a.objects.RuntimePermissions();
 //BA.debugLineNum = 10;BA.debugLine="Dim ruta As String";
_ruta = "";
 //BA.debugLineNum = 11;BA.debugLine="Dim skmt As SQL";
_skmt = new anywheresoftware.b4a.sql.SQL();
 //BA.debugLineNum = 12;BA.debugLine="End Sub";
return "";
}
public static String  _reg_click() throws Exception{
 //BA.debugLineNum = 100;BA.debugLine="Sub reg_Click";
 //BA.debugLineNum = 102;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
mostCurrent._b4xpages._showpage /*String*/ (mostCurrent.activityBA,"Cliente");
 //BA.debugLineNum = 103;BA.debugLine="End Sub";
return "";
}
}
