Scaling API-first – The story of a global engineering organization
Multiple User Profiles in Android_InnovationM
1. | Build a Mobile Experience
www.innovationm.com
Multiple User Profiles in Android
Corporate Office:
InnovationM Mobile Technologies
E-3 (Ground Floor), Sector-3, Noida 201301 (India)
t: +91 8447 227337 | e: info@innovationm.com
2. | Build a Mobile Experience
www.innovationm.com
Multiple User Profiles in Android
What is this offering from Android?
One Tablet used by multiple users – How can we shield users from seeing each other
stuff. Jelly Bean has an answer to it.
Just like Windows OS, several user profiles (accounts) can be created on Android from
Jelly Bean 4.2 (Tablets only) and onwards versions. This feature abstracts data
between users. See the possible use cases / situations below:
Situation (At Home) – Parents and children share the same Tablet. Parents can create
profiles and allow their children to see only those things that parents would like to. That
is great!
Situation (At Business) – Stewards in restaurants is taking orders from clients by
using application on Tablet. Admin (say Restaurant Manager) can create profiles for
stewards and allow only work related applications to be available to stewards.
I am sure there will be many more situations applicable.
How these multiple profiles are created?
A profile is created when Tablet is started for the first time. This is the owner.
Corporate Office:
InnovationM Mobile Technologies
E-3 (Ground Floor), Sector-3, Noida 201301 (India)
t: +91 8447 227337 | e: info@innovationm.com
3. | Build a Mobile Experience
www.innovationm.com
Owner will create multiple users. There are two types of users that can be created:
New AND User with Restricted Profile. Let us see them one by one.
User 1 (owner) is creating a New User
Corporate Office:
InnovationM Mobile Technologies
E-3 (Ground Floor), Sector-3, Noida 201301 (India)
t: +91 8447 227337 | e: info@innovationm.com
4. | Build a Mobile Experience
Corporate Office:
InnovationM Mobile Technologies
E-3 (Ground Floor), Sector-3, Noida 201301 (India)
t: +91 8447 227337 | e: info@innovationm.com
www.innovationm.com
5. | Build a Mobile Experience
www.innovationm.com
User 2 (New) is created - This user will start fresh as if the owner would start. Will have
its own app and content.
Now, let us create User 3 with Restricted Profile.
Corporate Office:
InnovationM Mobile Technologies
E-3 (Ground Floor), Sector-3, Noida 201301 (India)
t: +91 8447 227337 | e: info@innovationm.com
6. | Build a Mobile Experience
www.innovationm.com
User 3 is created. Will only see apps that were allowed. Play store app is shown but,
when launched, will prompt the user that permission is not there.
Switch users from Lock Screen and manage them from Settings > User screen
Corporate Office:
InnovationM Mobile Technologies
E-3 (Ground Floor), Sector-3, Noida 201301 (India)
t: +91 8447 227337 | e: info@innovationm.com
7. | Build a Mobile Experience
www.innovationm.com
Something for App Developers
1. Application data is not shared with users. While saving files on multiple user
environments do not use hard-coded paths to directories. Instead use following:
- For access to internal storage, use getFilesDir(), getCacheDir(), or openFileOutput().
- For access to external
storage, use getExternalFilesDir() orgetExternalStoragePublicDirectory().
2. While saving data in Shared Preferences you NEED NOT to take care of user.
System automatically manages by having separate Shared Preferences for each user.
3. Additionally, UserManager and UserHandle classes are provided to manage several
users but very limited function of these classes is allowed. UserManager class can be
used to check restrictions on user using getUserRestrictions() function.
Corporate Office:
InnovationM Mobile Technologies
E-3 (Ground Floor), Sector-3, Noida 201301 (India)
t: +91 8447 227337 | e: info@innovationm.com