Fog computing is expected to be an enabler of mobile cloud computing, which extends the cloud computing paradigm to the edge of the network. In the mobile cloud, not only central data centers but also pervasive mobile devices share their heterogeneous resources (e. g. CPUs, bandwidth, content) and support services. The mobile cloud based on such resource sharing is expected to be a powerful platform for mobile cloud applications and services. In this paper, we propose an architecture and mathematical framework for heterogeneous resource sharing based on the key idea of service-oriented utility functions. Since heterogeneous resources are often measured/quantified in disparate scales/units (e.g. power, bandwidth, latency), we present a unified framework where all these quantities are equivalently mapped to " time " resources. We formulate optimization problems for maximizing (i) the sum of the utility functions, and (ii) the product of the utility functions, and solve them via convex optimization approaches. Our numerical results show that service-oriented heterogeneous resource sharing reduces service latencies effectively and achieves high energy efficiency, making it attractive for use in the mobile cloud.