Hello there. First apologize for my english... I speak spanish.
I have done a project using "httputils" to parse a SQL query to a web server. IT WORKS GREAT! But i have some little problem...
When i do the query, and my projets label says "Please wait... Querying.... bla bla bla" but i only get the results WHEN I LOCK AND UNLOCK MY PHONE (WITH MY RIGHT PHISIC BUTTON)... What im doing wrong? I suspect i have put some code in the wrong Event, right?
I meant... if after the query, i didnt block the phone... i can wait forever to reults appears... but if i lock and unlock the phone... the results appears instantly!! Some "resume" problem?
I hope you understand me, my english is not good... This is a resumed part of the code...
Sub Activity_Create(FirstTime As Boolean)
Label1.Text ="Querying... wait please..."
If FirstTime Then
HttpUtils.CallbackActivity = "Main"
HttpUtils.CallbackJobDoneSub = "JobDone"
End If
HttpUtils.PostString("Job1", ServerUrl, "SELECT FIELD FROM MYTABLE")
End Sub
Sub Activity_Resume
If HttpUtils.Complete = True Then JobDone(HttpUtils.Job)
End Sub
Sub JobDone (Job As String)
If HttpUtils.IsSuccess(ServerUrl) Then
Dim parser As JSONParser
Dim response As String,LaCuota As String
response = HttpUtils.GetString(ServerUrl)
parser.Initialize(response)
Dim rows As List,Hay As Boolean
rows = parser.NextArray
Label1.Text ="Results:"
Hay=False
For i = 0 To rows.Size - 1
Hay=True
Dim m As Map
m = rows.Get(i)
ListView1.AddSingleLine("Field #" & m.Get("FIELD"))
Next
End If
HttpUtils.Complete = False
If Hay=False Then Label1.Text ="No results."
End Sub
Thank you very much!!!
I have done a project using "httputils" to parse a SQL query to a web server. IT WORKS GREAT! But i have some little problem...
When i do the query, and my projets label says "Please wait... Querying.... bla bla bla" but i only get the results WHEN I LOCK AND UNLOCK MY PHONE (WITH MY RIGHT PHISIC BUTTON)... What im doing wrong? I suspect i have put some code in the wrong Event, right?
I meant... if after the query, i didnt block the phone... i can wait forever to reults appears... but if i lock and unlock the phone... the results appears instantly!! Some "resume" problem?
I hope you understand me, my english is not good... This is a resumed part of the code...
Sub Activity_Create(FirstTime As Boolean)
Label1.Text ="Querying... wait please..."
If FirstTime Then
HttpUtils.CallbackActivity = "Main"
HttpUtils.CallbackJobDoneSub = "JobDone"
End If
HttpUtils.PostString("Job1", ServerUrl, "SELECT FIELD FROM MYTABLE")
End Sub
Sub Activity_Resume
If HttpUtils.Complete = True Then JobDone(HttpUtils.Job)
End Sub
Sub JobDone (Job As String)
If HttpUtils.IsSuccess(ServerUrl) Then
Dim parser As JSONParser
Dim response As String,LaCuota As String
response = HttpUtils.GetString(ServerUrl)
parser.Initialize(response)
Dim rows As List,Hay As Boolean
rows = parser.NextArray
Label1.Text ="Results:"
Hay=False
For i = 0 To rows.Size - 1
Hay=True
Dim m As Map
m = rows.Get(i)
ListView1.AddSingleLine("Field #" & m.Get("FIELD"))
Next
End If
HttpUtils.Complete = False
If Hay=False Then Label1.Text ="No results."
End Sub
Thank you very much!!!
Last edited: