Mobile grid (MG) is emergi ng as a new computing paradigm due to the ubiquitous availability of mobile devices. With the advancement in the capability of these devices, computationally intensive tasks can be executed using a peer-to-peer grid of such devices. MG can provide an edifice to execute parallel computationally intensive tasks. Key challenges that crop up while computing on a MG are resource constrained environment, inefficient resource allocation, high failure probability, etc. As a result, selection of appropriate nodes for task execution becomes critical for successful execution of the application. In this paper, we propose an efficient resource allocation model (ERAM) which provides resource allocation with failure handling. We created a MG comprising of Wi-Fi Direct connected Android smartphones. Different scenarios are considered for the purpose of experimentation. Our approach performs well with respect to application completion time, % battery consumption and recovery time from failure in comparison with existing techniques.