Android Question HTTPJOB fails only on Mobile Data

touchsquid

Active Member
Licensed User
Longtime User
I have a routine whch does a soap request and retreives a list of yacht races. It works perfectly on wifi, but not on mobile data. I have a very fast mobile data connection (5g) but it times out with no data. The same code works perfectly in IOS B4I.
I am not sure what the error is, as I can't test it in debug mode without wifi.

Any ideas?

B4X:
Public Sub GetRacesNear(Lat As Double, Lng As Double, DistMeters As Int) As ResumableSub
    Dim Result As String =""
    Dim req As String = File.ReadString(File.Dirassets, "GetRacesNear.xml")
    req=SetParam("Lat", Lat,req)
    req=SetParam("Lng", Lng,req)
    req=SetParam("DistMeters", DistMeters,req)
    Dim job1 As HttpJob
    job1.Initialize("GetRacesNear", Me)
    Dim URL As String = Connect
    Log(URL)
    job1.PostString(URL, req)
    job1.GetRequest.SetContentType("text/xml;  charset=utf-8")
    
    Wait For (job1) JobDone(job1 As HttpJob)
    If job1.Success Then
        Result= job1.getstring
        job1.Release
        Return GetRaceList (Result)
    Else
        Dim tlist As List
        tlist.Initialize
        tlist.Add("Error retrieving Data")
        job1.Release
        Return tlist
    End If
    

End Sub

Sub GetRaceList(Xml As String) As List[
/CODE]
 

JohnC

Expert
Licensed User
Longtime User
Is the URL an HTTPS or HTTP or a local network address like 192.xxx or 10.xxx?
 
Upvote 0

touchsquid

Active Member
Licensed User
Longtime User
I think the problem is with my phone. Although other sites work fine, trying to reach my server with Google on the phone times out. The exact same URL works in a flash on wifi. Will go to isp support.
 
Upvote 0

touchsquid

Active Member
Licensed User
Longtime User
Yes. I contacted my phone provider, fonusmobile, and they geve me a new eSim card, which fixed the problem. Nothing to do with B4A.
 
Upvote 0
Top