By playing around with the code more, I have found a clue. I have several activities and services which uses HttpClients to download data from the server in my project, and I have started converting HttpClient method to HttpUtils method. After successfully converting one Activity, when I tried using the httpUtils in service module, it was causing problems.
Can I not use httpUtils from a service module?
i have configured the service module like this.
'Service module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
' Dim httpClient1 As HttpClient
Dim app_version, server_version As String
' Dim url As String
Dim preferences_set As Boolean
HttpUtils.CallbackActivity = "RemoteManagement" ' Service Name
HttpUtils.CallbackJobDoneSub = "JobDone"
HttpUtils.CallbackUrlDoneSub = "URLdone"
Dim MainUrl As String
End Sub
sub functionOne
' httpClient1.InitializeAcceptAll("httpClient1")
' Dim req As HttpRequest
' req.InitializeGet(url & "update.txt")
' httpClient1.Execute(req, 1)
MainUrl = url & "update.txt"
HttpUtils.Download("checkUpdate", MainUrl)
end sub
.
.
.
.
.
etc
But i think in one post it is mentioned that you can't run two jobs at one time. So this service runs in the background of the activity, could this be the problem? If yes, how can I re-solve it please?
And presumably it is ok to use the Service Name in "HttpUtils.CallbackActivity" method.
As mentioned in my earlier post I was using HttpClient Method to communicate with the servers. It was all working fine until I started using Android 4.0 layout. Every time my app tries to connect to the server, it was giving me the error message. Then I read in one post that you can't use Http communication on the main thread, Android 4.0 doesn't allow it and was suggested to use the HttpUtil code module.
Help me please.