Android Example COVID API

API for live information about COVID-19

##source##


B4X:
Sub covid

    Dim cov1 As HttpJob
    cov1.Initialize("GetAddress", Me)
    cov1.Download("https://coronavirus-19-api.herokuapp.com/all/")
    Wait For (cov1) JobDone(cov1 As HttpJob)
    If cov1.Success Then
        ProgressDialogHide
        Dim parser As JSONParser
        parser.Initialize(cov1.GetString)
        Dim root As Map = parser.NextObject
        Dim recovered As Int = root.Get("recovered")
        Dim cases As Int = root.Get("cases")  
        Dim deaths As Int = root.Get("deaths")
       
   
    End If


    cov1.Release



End Sub
 

Attachments

  • cov.zip
    14.1 KB · Views: 512
  • Screenshot_1584876341.png
    Screenshot_1584876341.png
    8.4 KB · Views: 734
  • Screenshot_1584876347.png
    Screenshot_1584876347.png
    10.4 KB · Views: 802
  • Screenshot_1584895171.png
    Screenshot_1584895171.png
    18.2 KB · Views: 748
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Thank you
 

Ahmed.STorM

New Member
Excellent , But can't we use AutoCompleteEdit text in this project? , cuz i tried but, i failed .. i got all countries array from a website & modified it accoring to API asd.PNG
 

Almora

Active Member
Licensed User
Longtime User
[{"country":"World","cases":3322814,"todayCases":18594,"deaths":234408,"todayDeaths":578,"recovered":1050408,"active":2037998,"critical":50926,"casesPerOneMillion":426,"deathsPerOneMillion":30,"totalTests":0,"testsPerOneMillion":0}]

the last update date api is not included. add yourself with the timer.
 
Top