How we did it
Simulating multiple environment is not strange in computers. There are lots of methods, and all of them are summarized as one word: virtualization. But when it comes to mobile phones, the situation is getting troublesome. In fact, lack of resources makes some solutions sound like fantasy. Among all these solutions, container is one exception.
Container is a light-weight solution, which is supported firstly in Linux kernel. It is suitable for virtualization on mobile phones as it costs not much system resources. In traditional methods, what is virtualized is the hardware resources. But in container, it is the running environment of a process.
In Linux kernel, two features called Cgroup and Namespace are used for the container virtualization. There is an open-source project LXC (https://linuxcontainers.org), which provides series of user space tools to make the kernel features more convenient to use.
As is known to all, Android is the most popular smart phone OS, and the kernel of Android is Linux. So we choose Android and LXC to do our virtualization.