Mobile code offloading (MCO) is a technology that offloads computing tasks from mobile devices to remote servers managed by code offload service providers (CSPs). Nowadays, it is recommended that the remote servers be placed on the edge of the network to support modern applications, e.g., aug- mented reality, which demand stringent and ultra-low latency or high bandwidth. To date, previous studies have independently addressed code offloading policy in mobile devices and pric- ing/server provisioning policies in CSP; moreover, the system models for both user-side and CSP-side have not adequately reflected their practical aspects. This paper designs a practical model for the both sides and takes account of them in an inte- grated MCO framework simultaneously. By leveraging Lyapunov drift-plus-penalty technique, we propose code offloading, local CPU clock frequency, and network interface selection policies for mobile users, and propose MCO service pricing and server provisioning policies for CSP in each of a competition scenario and a cooperation scenario. (i) In the competition scenario, we propose a Com-UC algorithm for mobile users and a Com- PC algorithm for CSP with the aim to minimize each cost for each given delay constraint. (ii) In the cooperation scenario, we propose a Coo-JC algorithm with the aim to minimize their sum cost for both mobile users and CSP. Via trace-driven simulations, we demonstrate that Com-UC saves at most 71% of its cost and Com-PC attains 82% profit gain for the same delay compared to existing algorithms; moreover, the cooperation between mobile users and CSP additionally reduces costs and delays.