Hello ,
I am trying to run the same program at console mode that I ran previously at UI mode.
Below is the code
B4X:
Sub Process_Globals
End Sub
Sub AppStart (Args() As String)
'Log("Hello world!!!") ---> This is coming
Private j As HttpJob
j.Initialize("",Me)
j.Download("https://api.first.org/data/v1/countries")
Wait For (j) JobDone (j As HttpJob)
If j.Success Then
Dim jp As JSONParser
jp.Initialize(j.GetString)
Dim jroot As Map=jp.NextObject
Dim cdata As Map=jroot.Get("data")
For Each ctrykey In cdata.Keys
Log(cdata.Get(ctrykey)) ---> No log showing here
Next
End If
j.Release
End Sub
As this is my first program at Non-UI, I am lost
please advice on this.
Dim parser As JSONParser
parser.Initialize(<text>)
Dim jRoot As Map = parser.NextObject
Dim status-code As Int = jRoot.Get("status-code")
Dim access As String = jRoot.Get("access")
Dim data As Map = jRoot.Get("data")
Dim HK As Map = data.Get("HK")
Dim country As String = HK.Get("country")
Dim region As String = HK.Get("region")
Dim HM As Map = data.Get("HM")
Dim country As String = HM.Get("country")
Dim region As String = HM.Get("region")
Dim YT As Map = data.Get("YT")
Dim country As String = YT.Get("country")
Dim region As String = YT.Get("region")
Dim ID As Map = data.Get("ID")
Dim country As String = ID.Get("country")
Dim region As String = ID.Get("region")
Dim AF As Map = data.Get("AF")
Dim country As String = AF.Get("country")
Dim region As String = AF.Get("region")
Dim IN As Map = data.Get("IN")
Dim country As String = IN.Get("country")
Dim region As String = IN.Get("region")
Dim IO As Map = data.Get("IO")
Dim country As String = IO.Get("country")
Dim region As String = IO.Get("region")
Dim ZA As Map = data.Get("ZA")
Dim country As String = ZA.Get("country")
Dim region As String = ZA.Get("region")
Dim AM As Map = data.Get("AM")
Dim country As String = AM.Get("country")
Dim region As String = AM.Get("region")
Dim AO As Map = data.Get("AO")
Dim country As String = AO.Get("country")
Dim region As String = AO.Get("region")
Dim AQ As Map = data.Get("AQ")
Dim country As String = AQ.Get("country")
Dim region As String = AQ.Get("region")
Dim RE As Map = data.Get("RE")
Dim country As String = RE.Get("country")
Dim region As String = RE.Get("region")
Dim ZM As Map = data.Get("ZM")
Dim country As String = ZM.Get("country")
Dim region As String = ZM.Get("region")
Dim AZ As Map = data.Get("AZ")
Dim country As String = AZ.Get("country")
Dim region As String = AZ.Get("region")
Dim ZW As Map = data.Get("ZW")
Dim country As String = ZW.Get("country")
Dim region As String = ZW.Get("region")
Dim BD As Map = data.Get("BD")
Dim country As String = BD.Get("country")
Dim region As String = BD.Get("region")
Dim BF As Map = data.Get("BF")
Dim country As String = BF.Get("country")
Dim region As String = BF.Get("region")
Dim RW As Map = data.Get("RW")
Dim country As String = RW.Get("country")
Dim region As String = RW.Get("region")
Dim JP As Map = data.Get("JP")
Dim country As String = JP.Get("country")
Dim region As String = JP.Get("region")
Dim BI As Map = data.Get("BI")
Dim country As String = BI.Get("country")
Dim region As String = BI.Get("region")
Dim BJ As Map = data.Get("BJ")
Dim country As String = BJ.Get("country")
Dim region As String = BJ.Get("region")
Dim BN As Map = data.Get("BN")
Dim country As String = BN.Get("country")
Dim region As String = BN.Get("region")
Dim SC As Map = data.Get("SC")
Dim country As String = SC.Get("country")
Dim region As String = SC.Get("region")
Dim SD As Map = data.Get("SD")
Dim country As String = SD.Get("country")
Dim region As String = SD.Get("region")
Dim BT As Map = data.Get("BT")
Dim country As String = BT.Get("country")
Dim region As String = BT.Get("region")
Dim BV As Map = data.Get("BV")
Dim country As String = BV.Get("country")
Dim region As String = BV.Get("region")
Dim SG As Map = data.Get("SG")
Dim country As String = SG.Get("country")
Dim region As String = SG.Get("region")
Dim BW As Map = data.Get("BW")
Dim country As String = BW.Get("country")
Dim region As String = BW.Get("region")
Dim SH As Map = data.Get("SH")
Dim country As String = SH.Get("country")
Dim region As String = SH.Get("region")
Dim BZ As Map = data.Get("BZ")
Dim country As String = BZ.Get("country")
Dim region As String = BZ.Get("region")
Dim SL As Map = data.Get("SL")
Dim country As String = SL.Get("country")
Dim region As String = SL.Get("region")
Dim KE As Map = data.Get("KE")
Dim country As String = KE.Get("country")
Dim region As String = KE.Get("region")
Dim SN As Map = data.Get("SN")
Dim country As String = SN.Get("country")
Dim region As String = SN.Get("region")
Dim SO As Map = data.Get("SO")
Dim country As String = SO.Get("country")
Dim region As String = SO.Get("region")
Dim KG As Map = data.Get("KG")
Dim country As String = KG.Get("country")
Dim region As String = KG.Get("region")
Dim KH As Map = data.Get("KH")
Dim country As String = KH.Get("country")
Dim region As String = KH.Get("region")
Dim SS As Map = data.Get("SS")
Dim country As String = SS.Get("country")
Dim region As String = SS.Get("region")
Dim CD As Map = data.Get("CD")
Dim country As String = CD.Get("country")
Dim region As String = CD.Get("region")
Dim ST As Map = data.Get("ST")
Dim country As String = ST.Get("country")
Dim region As String = ST.Get("region")
Dim KM As Map = data.Get("KM")
Dim country As String = KM.Get("country")
Dim region As String = KM.Get("region")
Dim CF As Map = data.Get("CF")
Dim country As String = CF.Get("country")
Dim region As String = CF.Get("region")
Dim CG As Map = data.Get("CG")
Dim country As String = CG.Get("country")
Dim region As String = CG.Get("region")
Dim KP As Map = data.Get("KP")
Dim country As String = KP.Get("country")
Dim region As String = KP.Get("region")
Dim CI As Map = data.Get("CI")
Dim country As String = CI.Get("country")
Dim region As String = CI.Get("region")
Dim SZ As Map = data.Get("SZ")
Dim country As String = SZ.Get("country")
Dim region As String = SZ.Get("region")
Dim KR As Map = data.Get("KR")
Dim country As String = KR.Get("country")
Dim region As String = KR.Get("region")
Dim CM As Map = data.Get("CM")
Dim country As String = CM.Get("country")
Dim region As String = CM.Get("region")
Dim CN As Map = data.Get("CN")
Dim country As String = CN.Get("country")
Dim region As String = CN.Get("region")
Dim KZ As Map = data.Get("KZ")
Dim country As String = KZ.Get("country")
Dim region As String = KZ.Get("region")
Dim TD As Map = data.Get("TD")
Dim country As String = TD.Get("country")
Dim region As String = TD.Get("region")
Dim TF As Map = data.Get("TF")
Dim country As String = TF.Get("country")
Dim region As String = TF.Get("region")
Dim CV As Map = data.Get("CV")
Dim country As String = CV.Get("country")
Dim region As String = CV.Get("region")
Dim TG As Map = data.Get("TG")
Dim country As String = TG.Get("country")
Dim region As String = TG.Get("region")
Dim TH As Map = data.Get("TH")
Dim country As String = TH.Get("country")
Dim region As String = TH.Get("region")
Dim LA As Map = data.Get("LA")
Dim country As String = LA.Get("country")
Dim region As String = LA.Get("region")
Dim TJ As Map = data.Get("TJ")
Dim country As String = TJ.Get("country")
Dim region As String = TJ.Get("region")
Dim TL As Map = data.Get("TL")
Dim country As String = TL.Get("country")
Dim region As String = TL.Get("region")
Dim TM As Map = data.Get("TM")
Dim country As String = TM.Get("country")
Dim region As String = TM.Get("region")
Dim TN As Map = data.Get("TN")
Dim country As String = TN.Get("country")
Dim region As String = TN.Get("region")
Dim LK As Map = data.Get("LK")
Dim country As String = LK.Get("country")
Dim region As String = LK.Get("region")
Dim TW As Map = data.Get("TW")
Dim country As String = TW.Get("country")
Dim region As String = TW.Get("region")
Dim DJ As Map = data.Get("DJ")
Dim country As String = DJ.Get("country")
Dim region As String = DJ.Get("region")
Dim LR As Map = data.Get("LR")
Dim country As String = LR.Get("country")
Dim region As String = LR.Get("region")
Dim TZ As Map = data.Get("TZ")
Dim country As String = TZ.Get("country")
Dim region As String = TZ.Get("region")
Dim LS As Map = data.Get("LS")
Dim country As String = LS.Get("country")
Dim region As String = LS.Get("region")
Dim LY As Map = data.Get("LY")
Dim country As String = LY.Get("country")
Dim region As String = LY.Get("region")
Dim UG As Map = data.Get("UG")
Dim country As String = UG.Get("country")
Dim region As String = UG.Get("region")
Dim MA As Map = data.Get("MA")
Dim country As String = MA.Get("country")
Dim region As String = MA.Get("region")
Dim DZ As Map = data.Get("DZ")
Dim country As String = DZ.Get("country")
Dim region As String = DZ.Get("region")
Dim MG As Map = data.Get("MG")
Dim country As String = MG.Get("country")
Dim region As String = MG.Get("region")
Dim ML As Map = data.Get("ML")
Dim country As String = ML.Get("country")
Dim region As String = ML.Get("region")
Dim MM As Map = data.Get("MM")
Dim country As String = MM.Get("country")
Dim region As String = MM.Get("region")
Dim MN As Map = data.Get("MN")
Dim country As String = MN.Get("country")
Dim region As String = MN.Get("region")
Dim EG As Map = data.Get("EG")
Dim country As String = EG.Get("country")
Dim region As String = EG.Get("region")
Dim MO As Map = data.Get("MO")
Dim country As String = MO.Get("country")
Dim region As String = MO.Get("region")
Dim EH As Map = data.Get("EH")
Dim country As String = EH.Get("country")
Dim region As String = EH.Get("region")
Dim MR As Map = data.Get("MR")
Dim country As String = MR.Get("country")
Dim region As String = MR.Get("region")
Dim UZ As Map = data.Get("UZ")
Dim country As String = UZ.Get("country")
Dim region As String = UZ.Get("region")
Dim MU As Map = data.Get("MU")
Dim country As String = MU.Get("country")
Dim region As String = MU.Get("region")
Dim MV As Map = data.Get("MV")
Dim country As String = MV.Get("country")
Dim region As String = MV.Get("region")
Dim MW As Map = data.Get("MW")
Dim country As String = MW.Get("country")
Dim region As String = MW.Get("region")
Dim MY As Map = data.Get("MY")
Dim country As String = MY.Get("country")
Dim region As String = MY.Get("region")
Dim ER As Map = data.Get("ER")
Dim country As String = ER.Get("country")
Dim region As String = ER.Get("region")
Dim MZ As Map = data.Get("MZ")
Dim country As String = MZ.Get("country")
Dim region As String = MZ.Get("region")
Dim ET As Map = data.Get("ET")
Dim country As String = ET.Get("country")
Dim region As String = ET.Get("region")
Dim NA As Map = data.Get("NA")
Dim country As String = NA.Get("country")
Dim region As String = NA.Get("region")
Dim NE As Map = data.Get("NE")
Dim country As String = NE.Get("country")
Dim region As String = NE.Get("region")
Dim VN As Map = data.Get("VN")
Dim country As String = VN.Get("country")
Dim region As String = VN.Get("region")
Dim NG As Map = data.Get("NG")
Dim country As String = NG.Get("country")
Dim region As String = NG.Get("region")
Dim NP As Map = data.Get("NP")
Dim country As String = NP.Get("country")
Dim region As String = NP.Get("region")
Dim GA As Map = data.Get("GA")
Dim country As String = GA.Get("country")
Dim region As String = GA.Get("region")
Dim GE As Map = data.Get("GE")
Dim country As String = GE.Get("country")
Dim region As String = GE.Get("region")
Dim GH As Map = data.Get("GH")
Dim country As String = GH.Get("country")
Dim region As String = GH.Get("region")
Dim GM As Map = data.Get("GM")
Dim country As String = GM.Get("country")
Dim region As String = GM.Get("region")
Dim GN As Map = data.Get("GN")
Dim country As String = GN.Get("country")
Dim region As String = GN.Get("region")
Dim GQ As Map = data.Get("GQ")
Dim country As String = GQ.Get("country")
Dim region As String = GQ.Get("region")
Dim GS As Map = data.Get("GS")
Dim country As String = GS.Get("country")
Dim region As String = GS.Get("region")
Dim GW As Map = data.Get("GW")
Dim country As String = GW.Get("country")
Dim region As String = GW.Get("region")
Dim PH As Map = data.Get("PH")
Dim country As String = PH.Get("country")
Dim region As String = PH.Get("region")
Dim PK As Map = data.Get("PK")
Dim country As String = PK.Get("country")
Dim region As String = PK.Get("region")
Dim version As String = jRoot.Get("version")
Dim status As String = jRoot.Get("status")
Dim parser As JSONParser
parser.Initialize(<text>)
Dim jRoot As Map = parser.NextObject
Dim status-code As Int = jRoot.Get("status-code")
Dim access As String = jRoot.Get("access")
Dim data As Map = jRoot.Get("data")
Dim HK As Map = data.Get("HK")
Dim country As String = HK.Get("country")
Dim region As String = HK.Get("region")
Dim HM As Map = data.Get("HM")
Dim country As String = HM.Get("country")
Dim region As String = HM.Get("region")
Dim YT As Map = data.Get("YT")
Dim country As String = YT.Get("country")
Dim region As String = YT.Get("region")
Dim ID As Map = data.Get("ID")
Dim country As String = ID.Get("country")
Dim region As String = ID.Get("region")
Dim AF As Map = data.Get("AF")
Dim country As String = AF.Get("country")
Dim region As String = AF.Get("region")
Dim IN As Map = data.Get("IN")
Dim country As String = IN.Get("country")
Dim region As String = IN.Get("region")
Dim IO As Map = data.Get("IO")
Dim country As String = IO.Get("country")
Dim region As String = IO.Get("region")
Dim ZA As Map = data.Get("ZA")
Dim country As String = ZA.Get("country")
Dim region As String = ZA.Get("region")
Dim AM As Map = data.Get("AM")
Dim country As String = AM.Get("country")
Dim region As String = AM.Get("region")
Dim AO As Map = data.Get("AO")
Dim country As String = AO.Get("country")
Dim region As String = AO.Get("region")
Dim AQ As Map = data.Get("AQ")
Dim country As String = AQ.Get("country")
Dim region As String = AQ.Get("region")
Dim RE As Map = data.Get("RE")
Dim country As String = RE.Get("country")
Dim region As String = RE.Get("region")
Dim ZM As Map = data.Get("ZM")
Dim country As String = ZM.Get("country")
Dim region As String = ZM.Get("region")
Dim AZ As Map = data.Get("AZ")
Dim country As String = AZ.Get("country")
Dim region As String = AZ.Get("region")
Dim ZW As Map = data.Get("ZW")
Dim country As String = ZW.Get("country")
Dim region As String = ZW.Get("region")
Dim BD As Map = data.Get("BD")
Dim country As String = BD.Get("country")
Dim region As String = BD.Get("region")
Dim BF As Map = data.Get("BF")
Dim country As String = BF.Get("country")
Dim region As String = BF.Get("region")
Dim RW As Map = data.Get("RW")
Dim country As String = RW.Get("country")
Dim region As String = RW.Get("region")
Dim JP As Map = data.Get("JP")
Dim country As String = JP.Get("country")
Dim region As String = JP.Get("region")
Dim BI As Map = data.Get("BI")
Dim country As String = BI.Get("country")
Dim region As String = BI.Get("region")
Dim BJ As Map = data.Get("BJ")
Dim country As String = BJ.Get("country")
Dim region As String = BJ.Get("region")
Dim BN As Map = data.Get("BN")
Dim country As String = BN.Get("country")
Dim region As String = BN.Get("region")
Dim SC As Map = data.Get("SC")
Dim country As String = SC.Get("country")
Dim region As String = SC.Get("region")
Dim SD As Map = data.Get("SD")
Dim country As String = SD.Get("country")
Dim region As String = SD.Get("region")
Dim BT As Map = data.Get("BT")
Dim country As String = BT.Get("country")
Dim region As String = BT.Get("region")
Dim BV As Map = data.Get("BV")
Dim country As String = BV.Get("country")
Dim region As String = BV.Get("region")
Dim SG As Map = data.Get("SG")
Dim country As String = SG.Get("country")
Dim region As String = SG.Get("region")
Dim BW As Map = data.Get("BW")
Dim country As String = BW.Get("country")
Dim region As String = BW.Get("region")
Dim SH As Map = data.Get("SH")
Dim country As String = SH.Get("country")
Dim region As String = SH.Get("region")
Dim BZ As Map = data.Get("BZ")
Dim country As String = BZ.Get("country")
Dim region As String = BZ.Get("region")
Dim SL As Map = data.Get("SL")
Dim country As String = SL.Get("country")
Dim region As String = SL.Get("region")
Dim KE As Map = data.Get("KE")
Dim country As String = KE.Get("country")
Dim region As String = KE.Get("region")
Dim SN As Map = data.Get("SN")
Dim country As String = SN.Get("country")
Dim region As String = SN.Get("region")
Dim SO As Map = data.Get("SO")
Dim country As String = SO.Get("country")
Dim region As String = SO.Get("region")
Dim KG As Map = data.Get("KG")
Dim country As String = KG.Get("country")
Dim region As String = KG.Get("region")
Dim KH As Map = data.Get("KH")
Dim country As String = KH.Get("country")
Dim region As String = KH.Get("region")
Dim SS As Map = data.Get("SS")
Dim country As String = SS.Get("country")
Dim region As String = SS.Get("region")
Dim CD As Map = data.Get("CD")
Dim country As String = CD.Get("country")
Dim region As String = CD.Get("region")
Dim ST As Map = data.Get("ST")
Dim country As String = ST.Get("country")
Dim region As String = ST.Get("region")
Dim KM As Map = data.Get("KM")
Dim country As String = KM.Get("country")
Dim region As String = KM.Get("region")
Dim CF As Map = data.Get("CF")
Dim country As String = CF.Get("country")
Dim region As String = CF.Get("region")
Dim CG As Map = data.Get("CG")
Dim country As String = CG.Get("country")
Dim region As String = CG.Get("region")
Dim KP As Map = data.Get("KP")
Dim country As String = KP.Get("country")
Dim region As String = KP.Get("region")
Dim CI As Map = data.Get("CI")
Dim country As String = CI.Get("country")
Dim region As String = CI.Get("region")
Dim SZ As Map = data.Get("SZ")
Dim country As String = SZ.Get("country")
Dim region As String = SZ.Get("region")
Dim KR As Map = data.Get("KR")
Dim country As String = KR.Get("country")
Dim region As String = KR.Get("region")
Dim CM As Map = data.Get("CM")
Dim country As String = CM.Get("country")
Dim region As String = CM.Get("region")
Dim CN As Map = data.Get("CN")
Dim country As String = CN.Get("country")
Dim region As String = CN.Get("region")
Dim KZ As Map = data.Get("KZ")
Dim country As String = KZ.Get("country")
Dim region As String = KZ.Get("region")
Dim TD As Map = data.Get("TD")
Dim country As String = TD.Get("country")
Dim region As String = TD.Get("region")
Dim TF As Map = data.Get("TF")
Dim country As String = TF.Get("country")
Dim region As String = TF.Get("region")
Dim CV As Map = data.Get("CV")
Dim country As String = CV.Get("country")
Dim region As String = CV.Get("region")
Dim TG As Map = data.Get("TG")
Dim country As String = TG.Get("country")
Dim region As String = TG.Get("region")
Dim TH As Map = data.Get("TH")
Dim country As String = TH.Get("country")
Dim region As String = TH.Get("region")
Dim LA As Map = data.Get("LA")
Dim country As String = LA.Get("country")
Dim region As String = LA.Get("region")
Dim TJ As Map = data.Get("TJ")
Dim country As String = TJ.Get("country")
Dim region As String = TJ.Get("region")
Dim TL As Map = data.Get("TL")
Dim country As String = TL.Get("country")
Dim region As String = TL.Get("region")
Dim TM As Map = data.Get("TM")
Dim country As String = TM.Get("country")
Dim region As String = TM.Get("region")
Dim TN As Map = data.Get("TN")
Dim country As String = TN.Get("country")
Dim region As String = TN.Get("region")
Dim LK As Map = data.Get("LK")
Dim country As String = LK.Get("country")
Dim region As String = LK.Get("region")
Dim TW As Map = data.Get("TW")
Dim country As String = TW.Get("country")
Dim region As String = TW.Get("region")
Dim DJ As Map = data.Get("DJ")
Dim country As String = DJ.Get("country")
Dim region As String = DJ.Get("region")
Dim LR As Map = data.Get("LR")
Dim country As String = LR.Get("country")
Dim region As String = LR.Get("region")
Dim TZ As Map = data.Get("TZ")
Dim country As String = TZ.Get("country")
Dim region As String = TZ.Get("region")
Dim LS As Map = data.Get("LS")
Dim country As String = LS.Get("country")
Dim region As String = LS.Get("region")
Dim LY As Map = data.Get("LY")
Dim country As String = LY.Get("country")
Dim region As String = LY.Get("region")
Dim UG As Map = data.Get("UG")
Dim country As String = UG.Get("country")
Dim region As String = UG.Get("region")
Dim MA As Map = data.Get("MA")
Dim country As String = MA.Get("country")
Dim region As String = MA.Get("region")
Dim DZ As Map = data.Get("DZ")
Dim country As String = DZ.Get("country")
Dim region As String = DZ.Get("region")
Dim MG As Map = data.Get("MG")
Dim country As String = MG.Get("country")
Dim region As String = MG.Get("region")
Dim ML As Map = data.Get("ML")
Dim country As String = ML.Get("country")
Dim region As String = ML.Get("region")
Dim MM As Map = data.Get("MM")
Dim country As String = MM.Get("country")
Dim region As String = MM.Get("region")
Dim MN As Map = data.Get("MN")
Dim country As String = MN.Get("country")
Dim region As String = MN.Get("region")
Dim EG As Map = data.Get("EG")
Dim country As String = EG.Get("country")
Dim region As String = EG.Get("region")
Dim MO As Map = data.Get("MO")
Dim country As String = MO.Get("country")
Dim region As String = MO.Get("region")
Dim EH As Map = data.Get("EH")
Dim country As String = EH.Get("country")
Dim region As String = EH.Get("region")
Dim MR As Map = data.Get("MR")
Dim country As String = MR.Get("country")
Dim region As String = MR.Get("region")
Dim UZ As Map = data.Get("UZ")
Dim country As String = UZ.Get("country")
Dim region As String = UZ.Get("region")
Dim MU As Map = data.Get("MU")
Dim country As String = MU.Get("country")
Dim region As String = MU.Get("region")
Dim MV As Map = data.Get("MV")
Dim country As String = MV.Get("country")
Dim region As String = MV.Get("region")
Dim MW As Map = data.Get("MW")
Dim country As String = MW.Get("country")
Dim region As String = MW.Get("region")
Dim MY As Map = data.Get("MY")
Dim country As String = MY.Get("country")
Dim region As String = MY.Get("region")
Dim ER As Map = data.Get("ER")
Dim country As String = ER.Get("country")
Dim region As String = ER.Get("region")
Dim MZ As Map = data.Get("MZ")
Dim country As String = MZ.Get("country")
Dim region As String = MZ.Get("region")
Dim ET As Map = data.Get("ET")
Dim country As String = ET.Get("country")
Dim region As String = ET.Get("region")
Dim NA As Map = data.Get("NA")
Dim country As String = NA.Get("country")
Dim region As String = NA.Get("region")
Dim NE As Map = data.Get("NE")
Dim country As String = NE.Get("country")
Dim region As String = NE.Get("region")
Dim VN As Map = data.Get("VN")
Dim country As String = VN.Get("country")
Dim region As String = VN.Get("region")
Dim NG As Map = data.Get("NG")
Dim country As String = NG.Get("country")
Dim region As String = NG.Get("region")
Dim NP As Map = data.Get("NP")
Dim country As String = NP.Get("country")
Dim region As String = NP.Get("region")
Dim GA As Map = data.Get("GA")
Dim country As String = GA.Get("country")
Dim region As String = GA.Get("region")
Dim GE As Map = data.Get("GE")
Dim country As String = GE.Get("country")
Dim region As String = GE.Get("region")
Dim GH As Map = data.Get("GH")
Dim country As String = GH.Get("country")
Dim region As String = GH.Get("region")
Dim GM As Map = data.Get("GM")
Dim country As String = GM.Get("country")
Dim region As String = GM.Get("region")
Dim GN As Map = data.Get("GN")
Dim country As String = GN.Get("country")
Dim region As String = GN.Get("region")
Dim GQ As Map = data.Get("GQ")
Dim country As String = GQ.Get("country")
Dim region As String = GQ.Get("region")
Dim GS As Map = data.Get("GS")
Dim country As String = GS.Get("country")
Dim region As String = GS.Get("region")
Dim GW As Map = data.Get("GW")
Dim country As String = GW.Get("country")
Dim region As String = GW.Get("region")
Dim PH As Map = data.Get("PH")
Dim country As String = PH.Get("country")
Dim region As String = PH.Get("region")
Dim PK As Map = data.Get("PK")
Dim country As String = PK.Get("country")
Dim region As String = PK.Get("region")
Dim version As String = jRoot.Get("version")
Dim status As String = jRoot.Get("status")
Private Sub btn1_Click
'xui.MsgboxAsync("Hello world!", "B4X")
Dim j As HttpJob
j.Initialize("",Me)
j.Download("https://api.first.org/data/v1/countries")
wait for (j) JobDone (j As HttpJob)
If j.Success Then
Dim jp As JSONParser
jp.Initialize(j.GetString)
Dim rawdata As Map = jp.NextObject
Dim ckey As Map = rawdata.Get("data")
For Each cname As String In ckey.Keys
Log("Country Name = " & ckey.Get(cname).As(Map).Get("country"))
Next
End If
j.Release
End Sub
========Results=========
B4X:
Country Name = Mongolia
Country Name = Egypt
Country Name = Macao
Country Name = Western Sahara*
Country Name = Mauritania
Country Name = Uzbekistan
Country Name = Mauritius
Country Name = Maldives
Country Name = Malawi
Country Name = Malaysia
Country Name = Eritrea
Country Name = Mozambique
Country Name = Ethiopia
Country Name = Namibia
Country Name = Niger (the)
Country Name = Viet Nam
Country Name = Nigeria
Country Name = Nepal
Country Name = Gabon
Country Name = Georgia
Country Name = Ghana
Country Name = Gambia (the)
Country Name = Guinea
Country Name = Equatorial Guinea
Country Name = South Georgia and the South Sandwich Islands
Country Name = Guinea-Bissau
Country Name = Philippines (the)
Country Name = Pakistan
Sub AppStart (Args() As String)
Log("Hello world!!!")
makecall
StartMessageLoop
End Sub
Sub makecall() As ResumableSub
Dim succ As Boolean = False
Private j As HttpJob
j.Initialize("",Me)
j.Download("https://api.first.org/data/v1/countries")
Wait For (j) JobDone (j As HttpJob)
If j.Success Then
succ = True
Dim jp As JSONParser
jp.Initialize(j.GetString)
Dim jroot As Map=jp.NextObject
Dim data As Map = jroot.Get("data")
For Each key As String In data.Keys
Dim datamap As Map = data.Get(key)
Dim country As String = datamap.Get("country")
Dim region As String = datamap.Get("region")
Log($"${country}=${region}"$)
Next
'For Each ctrykey In cdata.Keys
' Log(cdata.Get(ctrykey)) ---> No Log showing here
'Next
End If
j.Release
StopMessageLoop
Return succ
End Sub