Variables

Variables are way to input some Locify-specific data into your XHTML pages. Variables enables you to get location-based data, use service settings and couple of other things.

All variables starts with char '$'. Variables can be used in URL's everywhere and in the value of <input> tags and as a special attribute locify:selected of <select> tag in forms.

Location-based data

  • $lat - current latitude in decimal format
  • $lon - current longitude in decimal format
  • $alt - current altitude in meters
  • $spe - current speed in km/h
  • $hea - current heading (0-360°)
  • $acc - vertical accuracy of location in meters

Service settings

Service settings is normal form, but it's action url is set to locify://serviceSettings. Values of this form are stored locally in client and you can use this settings in your XHTML pages. This is achieved by using variable:

  • $settings[variable_name] - value of given name from service settings

Client info

  • $client[time] - current time in user's phone as unix timestamp
  • $client[lang] - language of user's cell phone (can be different from language used in Locify - this information is available in user-agent string)
  • $client[version] - version of Locify client
  • $client[width] - available canvas width in pixels
  • $client[height] - available canvas height in pixels

User-agent

User-agent is small header sent with every request from Locify. You can find there information about Locify version and language selected in Locify. Format of user-agent string:

Locify/version/language/Additional_phone_info

Sample user-agent:

Locify/0.7.2/cs_CZ/SonyEricssonW960i/R100 Profile/MIDP-2.0 Configuration/CLDC-1.1