The main objective of a context-aware system is to translate sensor input into application action and adapted UI. In between, raw sensor information is used to build user context. It is very important to note that not all sensors have high contribution in defining user context. Contexts like “running” will probably only need the data from accelerometers.
One nice overview of a complete context-aware system is available here. The document is rather old, but clearly represents a very interesting high-level architecture. I think that this is the way to follow. In this architecture, DBUS can be used as the bridge between a context information daemon and applications.
Another challenge is context representation. What data structure should be used to model a user’s ever-changing context? My first guess is an extended finite state machine where contexts are represented by states and sensors inputs are the trigger conditions for state transition.