You are here :

English Leonardo Live Tracking API

Tuesday, 14. December 2010 11:18:08, by new acct

 

Contents

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

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

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

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

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;                    

No trackbacks yet

To make a trackback, use ping url http://www.livetrack24.com/wiki/tools/trackback/trackback.php?id=33

If your client support ping url auto discovery, you can also try it using directly this page's url

Comments

How to select "Car"?

Thursday, 4. February 2010 05:43:40, by Viktor Ilijasic

Hi,

could you please explain how to select other types of "vehicle", besides gliders?

I see in the api that a car could be selected (17100=>"Car"), but this option is not available in the GpsTrackLive.

http://www.livetrack24.com/wiki/en/Compatible%20Clients wiki page does boast that "You can only take full advantage of all Leonardo Live features with the custom made java client", but it seems this feature is not covered, along with many other vehicle types.

If it is not implemented, could you please implement it?

Is this the proper place to post a request, question?

Thanks,

Viktor

new version

Friday, 5. February 2010 14:55:41, by Manolis Andreadakis

Hi Viktor, the current java client, (my client, since there are some others also)
only supports the flying types, i'll release very shortly a new version that has all the other types

Excellent!

Friday, 5. February 2010 22:19:28, by Viktor Ilijasic

That would be excellent, thanks!