package b4a.example;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.pc.*;

public class main_subs_0 {


public static RemoteObject  _activity_create(RemoteObject _firsttime) throws Exception{
try {
		Debug.PushSubsStack("Activity_Create (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,31);
if (RapidSub.canDelegate("activity_create")) { return b4a.example.main.remoteMe.runUserSub(false, "main","activity_create", _firsttime);}
Debug.locals.put("FirstTime", _firsttime);
 BA.debugLineNum = 31;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
Debug.ShouldStop(1073741824);
 BA.debugLineNum = 35;BA.debugLine="t.Initialize(\"t\", 2000)";
Debug.ShouldStop(4);
main._t.runVoidMethod ("Initialize",main.processBA,(Object)(BA.ObjectToString("t")),(Object)(BA.numberCast(long.class, 2000)));
 BA.debugLineNum = 37;BA.debugLine="hs.Initialize(\"hotspot\")";
Debug.ShouldStop(16);
main.mostCurrent._hs.runVoidMethod ("Initialize",main.processBA,(Object)(RemoteObject.createImmutable("hotspot")));
 BA.debugLineNum = 39;BA.debugLine="End Sub";
Debug.ShouldStop(64);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _activity_pause(RemoteObject _userclosed) throws Exception{
try {
		Debug.PushSubsStack("Activity_Pause (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,49);
if (RapidSub.canDelegate("activity_pause")) { return b4a.example.main.remoteMe.runUserSub(false, "main","activity_pause", _userclosed);}
Debug.locals.put("UserClosed", _userclosed);
 BA.debugLineNum = 49;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
Debug.ShouldStop(65536);
 BA.debugLineNum = 51;BA.debugLine="t.Enabled = False";
Debug.ShouldStop(262144);
main._t.runMethod(true,"setEnabled",main.mostCurrent.__c.getField(true,"False"));
 BA.debugLineNum = 52;BA.debugLine="hs.disableHotSpot";
Debug.ShouldStop(524288);
main.mostCurrent._hs.runVoidMethod ("disableHotSpot");
 BA.debugLineNum = 54;BA.debugLine="End Sub";
Debug.ShouldStop(2097152);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _activity_resume() throws Exception{
try {
		Debug.PushSubsStack("Activity_Resume (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,41);
if (RapidSub.canDelegate("activity_resume")) { return b4a.example.main.remoteMe.runUserSub(false, "main","activity_resume");}
 BA.debugLineNum = 41;BA.debugLine="Sub Activity_Resume";
Debug.ShouldStop(256);
 BA.debugLineNum = 43;BA.debugLine="hs.enableHotSpot";
Debug.ShouldStop(1024);
main.mostCurrent._hs.runVoidMethod ("enableHotSpot");
 BA.debugLineNum = 44;BA.debugLine="DoEvents";
Debug.ShouldStop(2048);
main.mostCurrent.__c.runVoidMethodAndSync ("DoEvents");
 BA.debugLineNum = 45;BA.debugLine="t.Enabled = True";
Debug.ShouldStop(4096);
main._t.runMethod(true,"setEnabled",main.mostCurrent.__c.getField(true,"True"));
 BA.debugLineNum = 47;BA.debugLine="End Sub";
Debug.ShouldStop(16384);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _globals() throws Exception{
 //BA.debugLineNum = 23;BA.debugLine="Sub Globals";
 //BA.debugLineNum = 27;BA.debugLine="Dim hs As HotSpot";
main.mostCurrent._hs = RemoteObject.createNew ("hotspotwrapper.hotSpotWrapper");
 //BA.debugLineNum = 29;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _hotspot_scan_result(RemoteObject _client) throws Exception{
try {
		Debug.PushSubsStack("hotspot_scan_result (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,62);
if (RapidSub.canDelegate("hotspot_scan_result")) { return b4a.example.main.remoteMe.runUserSub(false, "main","hotspot_scan_result", _client);}
int _i = 0;
Debug.locals.put("client", _client);
 BA.debugLineNum = 62;BA.debugLine="Sub hotspot_scan_result (client() As String)";
Debug.ShouldStop(536870912);
 BA.debugLineNum = 64;BA.debugLine="For i = 0 To client.Length - 1";
Debug.ShouldStop(-2147483648);
{
final int step1 = 1;
final int limit1 = RemoteObject.solve(new RemoteObject[] {_client.getField(true,"length"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_i = 0 ;
for (;(step1 > 0 && _i <= limit1) || (step1 < 0 && _i >= limit1) ;_i = ((int)(0 + _i + step1))  ) {
Debug.locals.put("i", _i);
 BA.debugLineNum = 66;BA.debugLine="If client(i) <> Null Then";
Debug.ShouldStop(2);
if (RemoteObject.solveBoolean("N",_client.getArrayElement(true,BA.numberCast(int.class, _i)))) { 
 BA.debugLineNum = 67;BA.debugLine="Log(client(i))";
Debug.ShouldStop(4);
main.mostCurrent.__c.runVoidMethod ("LogImpl","3393221",_client.getArrayElement(true,BA.numberCast(int.class, _i)),0);
 BA.debugLineNum = 68;BA.debugLine="If (i + 1) mod 4 = 0 Then";
Debug.ShouldStop(8);
if (RemoteObject.solveBoolean("=",RemoteObject.solve(new RemoteObject[] {(RemoteObject.solve(new RemoteObject[] {RemoteObject.createImmutable(_i),RemoteObject.createImmutable(1)}, "+",1, 1)),RemoteObject.createImmutable(4)}, "%",0, 1),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 69;BA.debugLine="Log(\" \")";
Debug.ShouldStop(16);
main.mostCurrent.__c.runVoidMethod ("LogImpl","3393223",RemoteObject.createImmutable(" "),0);
 };
 };
 }
}Debug.locals.put("i", _i);
;
 BA.debugLineNum = 75;BA.debugLine="End Sub";
Debug.ShouldStop(1024);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}

public static void initializeProcessGlobals() {
    
    if (main.processGlobalsRun == false) {
	    main.processGlobalsRun = true;
		try {
		        main_subs_0._process_globals();
starter_subs_0._process_globals();
main.myClass = BA.getDeviceClass ("b4a.example.main");
starter.myClass = BA.getDeviceClass ("b4a.example.starter");
		
        } catch (Exception e) {
			throw new RuntimeException(e);
		}
    }
}public static RemoteObject  _process_globals() throws Exception{
 //BA.debugLineNum = 15;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 19;BA.debugLine="Dim t As Timer";
main._t = RemoteObject.createNew ("anywheresoftware.b4a.objects.Timer");
 //BA.debugLineNum = 21;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _t_tick() throws Exception{
try {
		Debug.PushSubsStack("t_tick (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,56);
if (RapidSub.canDelegate("t_tick")) { return b4a.example.main.remoteMe.runUserSub(false, "main","t_tick");}
 BA.debugLineNum = 56;BA.debugLine="Sub t_tick";
Debug.ShouldStop(8388608);
 BA.debugLineNum = 58;BA.debugLine="hs.scan";
Debug.ShouldStop(33554432);
main.mostCurrent._hs.runVoidMethod ("scan");
 BA.debugLineNum = 60;BA.debugLine="End Sub";
Debug.ShouldStop(134217728);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
}