The continuous technical progress in mobile device built-in modules and embedded sensing techniques creates opportunities for context-aware mobile applications. The context-aware computing paradigm exploits the relevant context as implicit input to characterise the user and physical environment and provide a computing service customised to the contextual situation. However, heterogeneity in techniques, complexity of contextual situation, and gap between raw sensor data and usable context keep the techniques from truly integration for extensive use. Studies in this area mainly focus on feasibility demonstration of the emerging techniques, and they lack general architecture support and appropriate service customisation strategy. This investigation aims to provide general system architecture and technical approaches to deal with the heterogeneity problem and efficiently utilise the dynamic context towards proactive computing service that is customised to the contextual situation. The main efforts of this investigation are the approaches to gathering, handling, and utilising the dynamic context information in an efficient way and the decision making and optimisation methods for computing service customisation. In brief, the highlights of this thesis cover the following aspects: (1) a hierarchical context-aware computing architecture supporting interoperable distribution and further use of context; (2) an in-depth analysis and classification of context and the corresponding context acquisition methods; (3) context modelling and context data representation for efficient and interoperable use of context; (4) a rulebased service customisation strategy with a rule generation mechanism to supervise the service customisation. In addition, feasibility demonstration of the proposed system and contribution justification of this investigation are conducted through case studies and prototype implementations. One case study uses mobile built-in sensing techniques to improve the usability and efficiency of mobile applications constrained by resource limitation, and the other employs the mobile terminal and embedded sensing techniques to predict users' expectations for home facility automatic control. Results demonstrate the feasibility of the proposed context handling architecture and service customisation methods. It shows great potential for employing the context of the computing environment for context-aware adaptation in pervasive and mobile applications but also indicates some underlying problems for further study.