Android Question Accessing NTRIP Mount Points

Terradrones

Active Member
Licensed User
Hi All

I want to add the option that the Surveyor can access NTRIP services which supplies GPS corrections to the Rover and which also cancels the need to have a Base Station.

The code that I use is as follows:

B4X:
Sub FindMountPoints
    Dim su As StringUtils
    Dim HttpClient As HttpJob
    
    HttpClient.Initialize("NTRIP", Me)

    ' Set the NTRIP caster URL and credentials
    Dim NTRIP_URL As String = "http://" & CGlobals.DF(68)
    Dim Username As String = CGlobals.DF(69)
    Dim Password As String = CGlobals.DF(70)


    Dim Username As String = CGlobals.DF(69)
    Dim Password As String = CGlobals.DF(70)
    Dim AuthString As String = Username & ":" & Password
    Dim AuthHeader As String = "Basic " & su.EncodeBase64(AuthString.GetBytes("UTF8"))

    ' Set the headers and send the request
    HttpClient.Download(NTRIP_URL)
    HttpClient.GetRequest.SetHeader("Authorization", AuthHeader)
    
End Sub

Sub JobDone (Job As HttpJob)
    If Job.Success Then
        Dim Response As String = Job.GetString
        Log("NTRIP Response: " & Response)
        ' Process the NTRIP data here to extract mount points
        Dim MountPoints As List
        MountPoints.Initialize
        Dim Lines() As String = Regex.Split(CRLF, Response)
        For Each Line As String In Lines
            If Line.StartsWith("STR") Then
                MountPoints.Add(Line)
            End If
        Next
        Log("Available Mount Points: " & MountPoints)
    Else
        Log("Error: " & Job.ErrorMessage)
    End If
    Job.Release
End Sub

I have added the following in my Manifest:

AddManifestText(android:usesCleartextTraffic="true")
AddManifestText(android:networkSecurityConfig="@xml/network_security_config")

I am doing something wrong, as it gives me some message about restricted.

I even tried AI.
 
Top