In mobile cloud computing, mobile devices seek to minimize computation time and/or energy consumption based on task related or user defined constraints. In earlier work [1], we proposed to minimize the total energy consumption across all the mobile devices in a cyber foraging system using a scheduler that runs in a centralized broker node, in situations where a large number of mobile devices could be expected. In this paper, we extend our earlier task scheduling problem for a large number of mobile devices to a mobile cloud computing environment. We optimally solve the task scheduling problem for task assignment to minimize the total energy consumption across the mobile devices subject to user defined constraints. Our task scheduler model at the centralized broker optimally offloads tasks and provides significant reduction in energy consumption compared to the energy consumption when tasks are offloaded from the centralized scheduler without optimization.