Toward a cooperative programming framework for context-aware applications