Android Question iam getting error while trying to download

Makumbi

Well-Known Member
Licensed User
Please help when i run this from B4a i get this error
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
ExecuteHtml: SELECT DISTINCT Names,Class || Stream As CS,Amount As Balance FROM Balances
6
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Activity (main) Pause, UserClosed = false **
** Activity (linkupdates) Create, isFirst = true **
** Activity (linkupdates) Resume **
ResponseError. Reason: java.net.UnknownHostException: Unable to resolve host "kccug.com": No address associated with hostname, Response:
ResponseError. Reason: java.net.UnknownHostException: Unable to resolve host "kccug.com": No address associated with hostname, Response:
** Activity (linkupdates) Pause, UserClosed = false **
** Activity (main) Resume **

B4X:
    Dim CustID As String = Phoneg' Customer ID
    Dim jt As HttpJob
    jt.Initialize("", Me)
    jt.Download("http://kccug.com/Generic_Handler_JSON/HandlerVBRegistration.ashx?customerid=" & CustID & "&sx=" & sx)
    jt.GetRequest.Timeout = 10000 ' 10 seconds
    Wait For (jt) JobDone(jt As HttpJob)

But when i run it from my browser it comes out well these details please help
B4X:
http://kccug.com/Generic_Handler_JSON/HandlerVBRegistration.ashx?customerid=0782911364&sx=Father
B4X:
[{"Account":"05-00001","Name":"BUGEMBE YASIN ismail","Stream":"A","Category":"Active","Country":"S2","Froms":"\/Date(1545512400000)\/","Tos":"\/Date(1554152400000)\/"}]
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Works fine here:
B4X:
Sub Activity_Create(FirstTime As Boolean)
   Dim jt As HttpJob
   jt.Initialize("", Me)
   jt.Download("http://kccug.com/Generic_Handler_JSON/HandlerVBRegistration.ashx?customerid=0782911364&sx=Father")
   Wait For (jt) JobDone(jt As HttpJob)
   If jt.Success Then
       Log(jt.GetString)
   End If
End Sub

Make sure that the device is connected to the internet.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…