1. You should remove the < and > characters (they only appear in their documentation to show you where you should insert the values).
2. It is better to use Download2:
B4X:
job1.Download2("http://ww2.insta-mapper.com/api/api_multi.php", Array As String("key", "11111111", "device_id", "111111"))
1. You should remove the < and > characters (they only appear in their documentation to show you where you should insert the values).
2. It is better to use Download2:
B4X:
job1.Download2("http://ww2.insta-mapper.com/api/api_multi.php", Array As String("key", "11111111", "device_id", "111111"))
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