I'm new to Android and I have to do an application at work that performs the following task:
- I listen to a socket that is supposed to send me a user name.
- After receiving the user name, I need to switch to that user account on a tablet.
- If I receive the same user name as the currently active user I don't need to switch (obviously).
Our tablets are rooted and running CyanogenMod 12.1 with Android 5.1.1 Lollipop. Since this is not a commercial version that will be downloaded from the Play Store I can assume that all permissions I may need will be granted.
I searched for a clean code way to do that without running shell commands or other hacks but couldn't find anything...