Android Question API implement and geo loaction...

Spectre

Active Member
Licensed User
Longtime User
It should be quite simple to use this API with HttpUtils2.

Hi Erel...
I guess it returns invalid caracter ... devas manage downloading2?


B4X:
Dim job1 As HttpJob

    job1.Initialize("Job1", Me)
    job1.Download("http://ww2.insta-mapper.com/api/api_multi.php?key=<11111111>&device_id=<11111111>")
 
Upvote 0

Spectre

Active Member
Licensed User
Longtime User
Hi

Thank ...
you characters I had already removed, it works with download ...
but I do not get anything in return jobdone (Job As HttpJob)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I´ve just created an insta-mapper account and have few minutes gps-tracking running...
I´ve created a small test-project.

But it works ... ;-)

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    Dim job As HttpJob
    job.Initialize("insta", Me)
    job.Download("http://ww2.insta-mapper.com/api/api_multi.php?key=12345&device_id=67890")
End Sub

Sub JobDone(job As HttpJob)
    If job.Success Then
        If job.JobName = "insta" Then
            Dim parser As JSONParser
            parser.Initialize(job.GetString2("utf-8"))
            Dim root As List = parser.NextArray
            Dim markers As Int = 0
            For Each colroot As Map In root
                markers = markers +1
                Dim minutes As String = colroot.Get("minutes")
                Dim speed As String = colroot.Get("speed")
                Dim altitude As String = colroot.Get("altitude")
                Dim battery As String = colroot.Get("battery")
                Dim device_id As String = colroot.Get("device_id")
                Dim lng As String = colroot.Get("lng")
                Dim friendly_name As String = colroot.Get("friendly_name")
                Dim accuracy As String = colroot.Get("accuracy")
                Dim kph As String = colroot.Get("kph")
                Dim heading As String = colroot.Get("heading")
                Dim lat As String = colroot.Get("lat")
                Dim Date As String = colroot.Get("Datetime")
            Next
            Log("Loaded "&markers&" markers...")
        End If
    Else
        Log("Error: "&job.ErrorMessage)
    End If
    job.Release
End Sub

Loaded 34 markers...

I´m here
 
Last edited:
Upvote 0

Spectre

Active Member
Licensed User
Longtime User
Hi!!!! Don...
I had not used the library JSONParser and it was much more complex ...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…