How can My app prevent a user from installing and launching certain apps?

Viewed 654

I am developing an app to be installed on children's phones, and once it is installed I would like it to prevent them from being able to install certain apps, let's say from a black list (not completely disabling the play store app).

It would also be great if it blocked launching pre-installed apps from the "black-list".

I am trying to avoid creating a "kiosk mode" app.

Is this possible?

2 Answers

Your application need to have admin privileges to control such conditions.

Scroll through this link for more detailed explanation.

Go through this link for Device administration feature This is irrespective of Cross Platform apps or Native Apps.

In Flutter, even if you try creating a plugin which can communicate to native layer, still the restrictions remain the same.

Moreover this ability gives you much more access than usual applications. Which is considered as dangerous.

Few API's are deprecated considering the security aspects. Details are given below.

With the release of Android 9.0, the following policies are marked as deprecated when invoked by a device admin, but the APIs otherwise continue to function.

USES_POLICY_DISABLE_CAMERA
USES_POLICY_DISABLE_KEYGUARD_FEATURES
USES_POLICY_EXPIRE_PASSWORD
USES_POLICY_LIMIT_PASSWORD

You could start by using flutter_package_manager to get the details of preinstalled apps, but that won't be much help for what you want to achieve.

I think that you will need to work natively with Android, and communicate with Flutter via Method Channels.

In android you can use PackageManager which has a lot of functionalities, for instance: setApplicationEnabledSetting etc

Using PackageManager, you should be able to achieve what you want.

Related