Restricted profile are now available in android from 4.3, i came to know that some apps like camera, gmail etc are not available in these kind of profiles. How can i manage these type of conditions in my app? Also how to manage in app products and restricted profile settings in corresponding to my app?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
you can use following code section to detect if your app is running in restricted profile mode !!
Thanks user370305 even if i already visited
http://developer.android.com/about/versions/android-4.3.html#RestrictedProfiles
I would like to improve it from reference with
https://www.youtube.com/watch?v=pdUcANNm72o
Restricted Profiles are a new feature introduced in Android Jelly Bean 4.3 that enables you to give users of your applications improved control when sharing their tablet.
These Restricted Profiles share apps, google account of primary user account but in a restricted manner.They dont get access to gmail, play store, calender etc. Primary user can select the restrictions for each applications.
UserManager Class is extended for managing these restrictions
UserManager.getUserRestrictions returns the user-wide restrictions imposed on the user specified
UserManager.getApplicationRestrictions returns a bundle containing any saved application restrictions for this user, for the given package name. Only an application with this package name can call this method.
If you need specific settings use this intent filter
now implement broadcast receiver with Restriction Entry list returned like this
RestrictionEntry
Any application that chooses to expose such restrictions does so by implementing a receiver that handles theACTION_GET_RESTRICTION_ENTRIES action. The receiver then returns a result bundle that contains an entry called "restrictions", whose value is an ArrayList.
There are 3 types of Restriction Entry
You can use different methods of RestrictionEntry to set and get different type of restrictions.
To get access to an account from a restricted profile, you must add the android:restrictedAccountType attribute to the tag:
The UI for users to control the restrictions you've built is managed by the system's Settings application. To make your app's restriction settings appear to the user, you must declare the restrictions your app provides by creating a
BroadcastReceiver
that receives theACTION_GET_RESTRICTION_ENTRIES
intent. The system invokes this intent to query all apps for available restrictions, then builds the UI to allow the primary user to manage restrictions for each restricted profile.For more info look at http://developer.android.com/about/versions/android-4.3.html#RestrictedProfiles