package com.merosee.bustrack.parent;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.debug.*;

public class apimodule {
private static apimodule mostCurrent = new apimodule();
public static Object getObject() {
    throw new RuntimeException("Code module does not support this method.");
}
 public anywheresoftware.b4a.keywords.Common __c = null;
public static String _serverurl = "";
public com.merosee.bustrack.parent.main _main = null;
public com.merosee.bustrack.parent.starter _starter = null;
public com.merosee.bustrack.parent.mapactivity _mapactivity = null;
public com.merosee.bustrack.parent.firebasemessaging _firebasemessaging = null;
public com.merosee.bustrack.parent.httputils2service _httputils2service = null;
public static String  _getstudents(anywheresoftware.b4a.BA _ba) throws Exception{
 //BA.debugLineNum = 21;BA.debugLine="Sub GetStudents As String";
 //BA.debugLineNum = 22;BA.debugLine="If File.Exists(File.DirInternal, \"students.json\")";
if (anywheresoftware.b4a.keywords.Common.File.Exists(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"students.json")) { 
 //BA.debugLineNum = 23;BA.debugLine="Return File.ReadString(File.DirInternal, \"studen";
if (true) return anywheresoftware.b4a.keywords.Common.File.ReadString(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"students.json");
 };
 //BA.debugLineNum = 25;BA.debugLine="Return \"\"";
if (true) return "";
 //BA.debugLineNum = 26;BA.debugLine="End Sub";
return "";
}
public static String  _gettoken(anywheresoftware.b4a.BA _ba) throws Exception{
 //BA.debugLineNum = 6;BA.debugLine="Sub GetToken As String";
 //BA.debugLineNum = 7;BA.debugLine="If File.Exists(File.DirInternal, \"parent_token.tx";
if (anywheresoftware.b4a.keywords.Common.File.Exists(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"parent_token.txt")) { 
 //BA.debugLineNum = 8;BA.debugLine="Return File.ReadString(File.DirInternal, \"parent";
if (true) return anywheresoftware.b4a.keywords.Common.File.ReadString(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"parent_token.txt");
 };
 //BA.debugLineNum = 10;BA.debugLine="Return \"\"";
if (true) return "";
 //BA.debugLineNum = 11;BA.debugLine="End Sub";
return "";
}
public static String  _process_globals() throws Exception{
 //BA.debugLineNum = 2;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 3;BA.debugLine="Public ServerURL As String = \"https://bustrack";
_serverurl = "https://bustrack.merosee.com/api";
 //BA.debugLineNum = 4;BA.debugLine="End Sub";
return "";
}
public static String  _registerfcmtoken(anywheresoftware.b4a.BA _ba,String _phone,String _token) throws Exception{
anywheresoftware.b4a.objects.collections.Map _data = null;
anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator _json = null;
com.merosee.bustrack.parent.httpjob _job = null;
 //BA.debugLineNum = 28;BA.debugLine="Sub RegisterFCMToken(Phone As String, Token As Str";
 //BA.debugLineNum = 29;BA.debugLine="Dim data As Map";
_data = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 30;BA.debugLine="data.Initialize";
_data.Initialize();
 //BA.debugLineNum = 31;BA.debugLine="data.Put(\"phone\", Phone)";
_data.Put((Object)("phone"),(Object)(_phone));
 //BA.debugLineNum = 32;BA.debugLine="data.Put(\"token\", Token)";
_data.Put((Object)("token"),(Object)(_token));
 //BA.debugLineNum = 34;BA.debugLine="Dim json As JSONGenerator";
_json = new anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator();
 //BA.debugLineNum = 35;BA.debugLine="json.Initialize(data)";
_json.Initialize(_data);
 //BA.debugLineNum = 37;BA.debugLine="Dim job As HttpJob";
_job = new com.merosee.bustrack.parent.httpjob();
 //BA.debugLineNum = 38;BA.debugLine="job.Initialize(\"register_fcm\", Main)";
_job._initialize /*String*/ ((_ba.processBA == null ? _ba : _ba.processBA),"register_fcm",(Object)(mostCurrent._main.getObject()));
 //BA.debugLineNum = 39;BA.debugLine="job.PostString(ServerURL & \"/register_fcm.php\", j";
_job._poststring /*String*/ (_serverurl+"/register_fcm.php",_json.ToString());
 //BA.debugLineNum = 40;BA.debugLine="job.GetRequest.SetHeader(\"Content-Type\", \"applica";
_job._getrequest /*anywheresoftware.b4h.okhttp.OkHttpClientWrapper.OkHttpRequest*/ ().SetHeader("Content-Type","application/json");
 //BA.debugLineNum = 41;BA.debugLine="End Sub";
return "";
}
public static String  _savestudents(anywheresoftware.b4a.BA _ba,String _studentsjson) throws Exception{
 //BA.debugLineNum = 17;BA.debugLine="Sub SaveStudents(studentsJson As String)";
 //BA.debugLineNum = 18;BA.debugLine="File.WriteString(File.DirInternal, \"students.json";
anywheresoftware.b4a.keywords.Common.File.WriteString(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"students.json",_studentsjson);
 //BA.debugLineNum = 19;BA.debugLine="End Sub";
return "";
}
public static String  _savetoken(anywheresoftware.b4a.BA _ba,String _token) throws Exception{
 //BA.debugLineNum = 13;BA.debugLine="Sub SaveToken(token As String)";
 //BA.debugLineNum = 14;BA.debugLine="File.WriteString(File.DirInternal, \"parent_token.";
anywheresoftware.b4a.keywords.Common.File.WriteString(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"parent_token.txt",_token);
 //BA.debugLineNum = 15;BA.debugLine="End Sub";
return "";
}
}
