The Urban Mobile Cloud Computing (UMCC) framework is a mobile cloud computing model that describes the flows of data and operations taking place in the Smart City scenario. By means of the UMCC framework, and considering various configurations of clouds and networks, data storage and processing can be dynamically delegated to resource-rich devices, thus shortening execution time, extending battery life and exploiting the possibility to preserve data in the cloud. The UMCC framework can effectively support the Smart City vision, gathering, collecting and processing data in real time, aiming to take advantage of the most advanced communication technologies, to hold up added-value services for the administration of the city and for the citizens. In this paper, we show how system optimization can be driven by purposely defined cost functions, including throughput, energy efficiency, latency and computing performance. The challenges and the opportunities of exploiting the UMCC are discussed in relation to Smart City solutions, highlighting the features that can affect the Quality of Service (QoS) of various types of Smart City related applications.