Context.properties
From MobiComp
The Context.properties file
Basic Context.properties files for linux, Windows XP and Windows CE can be found in the platform-specific directories under lib. The appropriate file should be copied to mobicomp for testing purposes, but should never be checked in to the repository. When programs are run, this file will be updated with device-specific information, including a unique identifier assigned by the server.
When the software is installed on a different device, it is essential to install only the basic Context.properties file, NOT a version that has been updated. A basic file contains only the following lines (Windows XP example):
#Context properties device.type=desktop webBrowser="C:\\Program files\\Internet explorer\\iexplore.exe" http.url=http://www.piranesi.dyndns.org/Context/ContextServlet http.interval=-1 debug=false retry.interval=60
The properties included here have the following meanings. Most can be changed to suit your installation.
- device.type set to one of phone, PDA, laptop, desktop as appropriate.
- webBrowser should contain the full path of the preferred browser on the device. Quotes are usually required for Windows paths.
- http.url a comma-separated list of servers with which the local ContextService should attempt to communicate.
- http.interval determines the frequency of communication with the server(s):
- -1 communication is disabled,
- 0 communication is continuous, updates are sent to the server(s) immediately,
- otherwise, the interval in seconds between attempts to communicate with the server(s).
- debug if true, generates more verbose output to the console or log file.
- retry.interval length of delay in seconds before re-trying following a communication failure.
When updated by the running system, the file will look something like this (Windows XP laptop example):
#Context properties #Wed Jul 26 15:16:30 BST 2006 http.url=http\://www.piranesi.dyndns.org/Context/ContextServlet,http\://192.168.1.5/Context/ContextServlet debug=true delayStart=false http.interval=0 user.name=nsr user.email=n.s.ryan@kent.ac.uk updated=2006-07-26T14\:16\:30 retry.interval=60 device.id=1921176554400a5be91e46e735c67024 device.desc=Windows XP, x86, 5.1, java 1.5.0_06, Sun Microsystems Inc. device.type=laptop webBrowser="C:\\Program files\\Internet explorer\\iexplore.exe"
The additional properties here are:
- delayStart should normally be false, see ContextService code for information on delaying the service startup.
- user.name and user.email edit file to set these as required. These may be added to a basic Context.properties file before first use.
- updated timestamp indicating the last successful communication with the server(s).
- device.id a unique identifier for the device, supplied by the server when the device initially registers.
- device.desc automatically generated information about the device

