At present, people’s learning styles become diverse, for which mobile learning is a significant trend that enables distributed learners to achieve collaborative learning and allows them to be engaged in virtual teams to work together. In this research, we develop a system to cope with the problem in current mobile learning circumstance, where learners in virtual teams generally lack proper communications, guidance and assistances between each other. Following the theory of Kolb team learning experience, we use our system, Teamwork as a Service (TaaS), to work in conjunction with cloud-based learning management systems. This system targets at organizing a series of learning activities and then forming a learning flow in order to allow learners to participate into smart collaborations. Executing the five web services of TaaS sequentially, learners can have their collaborative learning arranged in a better environment, where they are able to know about one another, be grouped into cloud-based ‘Jigsaw Classroom’, plan and publish tasks and supervise other learners mutually. In particular, one primary point of enhancing learners’ teamwork performance is to offer them computational choice of task allocation. For this reason, we model the social features related to the collaborative learning activities, and introduce a genetic algorithm (GA) approach to group learners into appropriate teams with two different team formation scenarios. The technical details of the operation principle of GA are illustrated thoroughly. Finally, experimental results are presented to prove our approach is workable to facilitate teamwork with considerations of learner’s capabilities and preferences. We also demonstrate our implementation details of the newly designed TaaS over the Amazon cloud and discuss the main improvements for collaborative learning brought by TaaS.