With the development of the mobile technology, smart phone plays a increasingly important role in people's life which makes it attractive to integrate the context-aware computing with the phone.Middleware is the most common method to support context-aware applications which use the context information to adapt interfaces to respond to user. But the relative weak comput ing power of the phone and the complex uncertain environment become the Achilles' heel for middleware systems on the mobile devices. This paper presents a Context-Aware Reasoning Middle ware(CARM) which provides a solution by adopting the Bayesian network for uncertain inference and designing a mechanism togive the middleware an access to powerful computation ability.We implement the middleware system and shown that the CARM lets applications on the phone to gain the ability of becoming more context-aware.