Android Question Retrieve Data Row from Web Service

Discussion in 'Android Questions' started by hendrayulianto, Jun 17, 2015.

  1. hendrayulianto

    hendrayulianto Member Licensed User

  2. eurojam

    eurojam Well-Known Member Licensed User

    You have to make you familar with httpUtils and Json. Then it is not that much to do. I hve made a small example to give you a starting point. My provided example is a bit of dirty hack... you need to examine the response from the webservice....(see this great tool from Erel:

    The example uses the httpUtils2 and JSON Libs.
    Sub Globals
    Dim lv As ListView
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
    Dim s As String
    Dim job1 As HttpJob
        s = 
    "Job1", Me)
    End Sub

    Sub JobDone (Job As HttpJob)
    Dim s As String
    If Job.Success = True Then
    Select Job.JobName
    Case "Job1"
               s = Job.GetString
    End Select
    End If      
    End Sub

    Sub ParsJSON (jsonstring As String)
    Dim a,b As Int
       a = jsonstring.IndexOf(
       b = jsonstring.LastIndexOf(
       jsonstring = jsonstring.SubString2(a, b+

    Dim parser As JSONParser


    Dim root As List = parser.NextArray
    For Each colroot As Object In root
    If colroot Is List Then
    Dim l As List
         l = colroot
    'show the emails adress in the listview
    End If   
    End Sub
    Erel and DonManfred like this.
  3. Erel

    Erel Administrator Staff Member Licensed User

    (Don't forget to call Job.Release at the end of JobDone)
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice