J Jamsa Member Licensed User Longtime User Nov 30, 2011 #1 I trying to get data from my database using HttpUtils. I've got the basic working without issues. Yay. But when I try to integrate it into my project, it doesn't work no matter what I try.:BangHead: I can send the query fine as the last HttpUtils log msg is "Starting Job: POST AppInfo" But I don't get a result back for some reason. I've tried using a timer to give time for the server to respond, but it doesn't help(, or I'm doing it wrong) I got the code in a code module called Classification: Code: Copy Sub Process_Globals ... MainUrl = "http://www.emzla.dk/test.php" HttpUtils.CallbackActivity = "Classification" HttpUtils.CallbackJobDoneSub = "JobDone" ... End Sub Sub JobDone (Job As String) Select Job Case "POST AppInfo" Log("JobDone...POST AppInfo") If HttpUtils.IsSuccess(MainUrl) Then Log(HttpUtils.GetString(MainUrl)) End If Case "POST AppList" Log("JobDone...POST AppList") If HttpUtils.IsSuccess(MainUrl) Then Log(HttpUtils.GetString(MainUrl)) End If GetAppDataOnPhone End Select HttpUtils.Complete = False 'Turn off the complete flag so we won't handle it again if the activity is resumed. End Sub Futher down(same module) I start the "db action": Code: Copy Sub GetListOfAppInfo ProgressDialogShow("Fetching data...") HttpUtils.PostString("POST AppInfo", MainUrl, "SELECT * FROM AppList") End Sub The function GetAppDataOnPhone uses the data from the db, but since nothing has come back, no data gets worked.
I trying to get data from my database using HttpUtils. I've got the basic working without issues. Yay. But when I try to integrate it into my project, it doesn't work no matter what I try.:BangHead: I can send the query fine as the last HttpUtils log msg is "Starting Job: POST AppInfo" But I don't get a result back for some reason. I've tried using a timer to give time for the server to respond, but it doesn't help(, or I'm doing it wrong) I got the code in a code module called Classification: Code: Copy Sub Process_Globals ... MainUrl = "http://www.emzla.dk/test.php" HttpUtils.CallbackActivity = "Classification" HttpUtils.CallbackJobDoneSub = "JobDone" ... End Sub Sub JobDone (Job As String) Select Job Case "POST AppInfo" Log("JobDone...POST AppInfo") If HttpUtils.IsSuccess(MainUrl) Then Log(HttpUtils.GetString(MainUrl)) End If Case "POST AppList" Log("JobDone...POST AppList") If HttpUtils.IsSuccess(MainUrl) Then Log(HttpUtils.GetString(MainUrl)) End If GetAppDataOnPhone End Select HttpUtils.Complete = False 'Turn off the complete flag so we won't handle it again if the activity is resumed. End Sub Futher down(same module) I start the "db action": Code: Copy Sub GetListOfAppInfo ProgressDialogShow("Fetching data...") HttpUtils.PostString("POST AppInfo", MainUrl, "SELECT * FROM AppList") End Sub The function GetAppDataOnPhone uses the data from the db, but since nothing has come back, no data gets worked.
Erel B4X founder Staff member Licensed User Longtime User Nov 30, 2011 #2 Are you writing this code in the main activity or an activity named Classification? Upvote 0
J Jamsa Member Licensed User Longtime User Nov 30, 2011 #3 Erel said: Are you writing this code in the main activity or an activity named Classification? Click to expand... All the code above is from the code module Classification Upvote 0
Erel said: Are you writing this code in the main activity or an activity named Classification? Click to expand... All the code above is from the code module Classification
J Jamsa Member Licensed User Longtime User Nov 30, 2011 #4 Jamsa said: All the code above is from the code module Classification Click to expand... ...and after reading this: http://www.b4x.com/forum/basic4android-getting-started-tutorials/7541-static-code-modules.html I guess that's my problem...? Upvote 0
Jamsa said: All the code above is from the code module Classification Click to expand... ...and after reading this: http://www.b4x.com/forum/basic4android-getting-started-tutorials/7541-static-code-modules.html I guess that's my problem...?