Android 4.2 & above supports Multiple Users as described at below link...
http://developer.android.com/about/versions/android-4.2.html#MultipleUsers
Now, my questions are..
Is it possible to know multiple user configured in device programmatically ? If yes, then how to get number of user configured in device ?
Is it possible to get list of users ? if yes then how ?
There is a public API to get user details but it is restricted to apps which have the
"android.permission.MANAGE_USERS"
permission. This permission has a protection level of"signature|system"
, so unless your app is installed to the system partition there is no official way to get the number of users.I looked over the source code and came up with the following solution:
It has worked on the brief testing I have done but it is not used in any production code. It needs more testing but should work.
If your app had system level permissions this would be much easier: