Mobile learning is an emerging trend that brings many advantages to distributed learners, enabling them to achieve collaborative learning, in which the virtual teams are usually built to engage multiple learners working together towards the same pedagogical goals in online courses. However, the socio-technical mechanisms to enhance teamwork performance are lacking. To meet this gap, we adopt the social computing to affiliate learners’ behaviors and offer them computational choices to build a better collaborative learning context. Combining the features of the cloud environment, we have identified a learning flow based on Kolb team learning experience to realize this approach. Such novel learning flow can be executed by our newly designed system, Teamwork as a Service (TaaS), in conjunction with the cloud-hosting learning management systems. Following this learning flow, learners benefit from the functions provided by cloud-based services when cooperating in a mobile environment, being organized into cloud-based teaching strategies namely “Jigsaw Classroom”, planning and publishing tasks, as well as rationalizing task allocation and mutual supervision. In particular, we model the social features related to the collaborative learning activities, and introduce a genetic algorithm approach to grouping learners into appropriate teams with two different team formation scenarios. Experimental results prove our approach is able to facilitate teamwork, while learners’ capabilities and preferences are taken into consideration. In addition, empirical evaluations have been conducted to show the improvement of collaborative learning brought by TaaS in real university level courses.