Get Started Login Sign Up Contact

LiveTracking API

LiveTrack24 - LiveTracking API[en]

LiveTrack24

 

There are 2 ways to add live tracking support to your application. You cant mix the 2 ways, stick to and use only one of them in your application.

Both are using HTTP GET requests to www.livetrack24.com/track.php with specific parameters By using test.livetrack24.com/track.php instead the tracks go to the test server. Use this while developing/testing.

Generic - Sessionless protocol

This is deprecagted and no longer works

Example URL

/track.php?leolive=1&client=YourProgramName&v=1&lat=22.3&lon=40.2&alt=23&sog=40&cog=160&tm=1241422845&user=yourusername&pass=yourpass

Native - Session aware protocol

START OF TRACK PACKET

/track.php?leolive=2&sid=42664778&pid=1&client=YourProgramName&v=1&user=yourusername&pass=yourpass&phone=Nokia 2600c&gps=BT GPS&trk1=4&vtype=16388&vname=vehicle name and model

PARAMETERS

  • leolive=2 // 2 means this is the start of track packet
  • sid=42664778 // the session ID , see below on sessionID section for more information
  • pid=1 // the packet number of this packet, we start with 1 and increase with each packet send either start/end or with GPS data.
  • client=YourClientName// fixed value use only alphanumerics no spaces, first Letter of words in capitals
  • user=yourusername // there is no need to have a registered user, the user can input his preferred username on the fly, he will be displayed in black instead of blue if not registered.
  • pass=yourpass
  • v=1 // version of your program you can use free text like 1.4.5
  • trk1=4 // the interval in secs that we will be sending gps points
  • phone=Nokia 2600c // the phone model as it is acquired from a system call
  • &gps=BT GPS // the GPS name , use the string Internal GPS for phones with integrated GPS
  • vname // the brand + name of the vehicle/glider ie Gradient Golden 2 26

Values for vtype

1=>"Paraglider"
2=>"Flex wing FAI1"
4=>"Rigid wing FAI5"
8=>"Glider"
16=>"Paramotor"
32=>"Trike"
64=>"Powered flight"
128=>"Hot Air Balloon"

16385=>"Walk"
16386=>"Run" 
16388=>"Bike"

16400=>"Hike"
16401=>"Cycle"
16402=>"Mountain Bike"
16403=>"Motorcycle"

16500=>"Windsurf"
16501=>"Kitesurf"				
16502=>"Sailing"

16600=>"Snowboard"
16601=>"Ski"
16602=>"Snowkite"

17100=>"Car"
17101=>"4x4 Car"

END OF TRACK PACKET

/track.php?leolive=3&sid=42664778&pid=453&prid=0

PARAMETERS

  • leolive=3 // 3 means this is the end of track packet
  • prid=0 // the status of the user
0-> "Everything OK"
1-> "Need retrieve"
2-> "Need some help, nothing broken"
3-> "Need help, maybe something broken"
4-> "HELP, SERIOUS INJURY"

GPS POINT PACKET

/track.php?leolive=4&sid=42664778&pid=321&lat=22.3&lon=40.2&alt=23&sog=40&cog=160&tm=1241422845

PARAMETERS

  • leolive=4 // 4 means this is a gps point
  • lat=22.3 // the latitude in decimal notation, use negative numbers for west
  • lon=40.2 // lon in decimal, use negative numbers for south
  • alt=23 // altitude in meters above the MSL (not the geoid if it is possible) , no decimals
  • sog=40 // speed over ground in km/h no decimals
  • cog=160 // course over ground in degrees 0-360, no decimals
  • tm=1241422845 // the unixt timestamp in GMT of the GPS time, not the phone's time.

Info on sessionID

The "sid" (sessionID) parameter uniquely identifies a single track , it must be the same in all packets

Random SessionID

Use a 4 byte unsigned random int, the leftmost bit ( 0x80000000 ) MUST be set to 0 so you must do a sessionID & 0x7fffffff

Setting the userID inside sessionID

If the user has an account on the server then the sessionID must be constructed in the following way to contain the userID

First of all your application must get the userID based on the username and password of the user. The url to verify user accounts and get back the userID is

http://www.livetrack24.com/client.php?op=login&user=username&pass=pass

The username and password are case INSENSITIVE, because on mobile devices it is not easy for all users to enter the correct case.

The result of the page is an integer, 0 if userdata are incorrect, or else the userID of the user

Here is a sample code in Java to construct a sessionID from a userID

Random a= new Random( System.currentTimeMillis() );
int rnd=a.nextInt();
// we make an int with leftmost bit=1 ,
// the next 7 bits random 
// (so that the same userID can have multiple active sessions)
// and the next 3 bytes the userID
rnd=( rnd &  0x7F000000 ) | ( userID & 0x00ffffff) | 0x80000000;