How to block or hide app access on Android?
Asked Answered
G

2

6

I want to know from your experience what are the best practices for remotely block/hide Android App?

With iOS you can hide certain (or all) apps with iOS profile and push the profile to iOS using MDM Server (if iOS in supervised mode)

Some people suggest creating an android app that monitors the foreground app and creates an overlay on top of it. do you think about this?

Gredel answered 25/10, 2018 at 5:35 Comment(3)
To add more clarification to the question, I want to create an Android app that can monitor which android app in foreground and disable this app or enable it based on list of approved/disapproved apps - is this possible with android ? Any suggestion from where I can start to read more about it?Gredel
Are you already aware of these?developers.google.com/android/management developer.android.com/guide/topics/admin/device-admin developer.android.com/work/dpc/build-dpcBeggs
Android Management Api will help you in this case. I developed an application through which you can directly access, enable or disable apps, or force install and uninstall apps. developers.google.com/android/managementHon
J
5

Let me tell you briefly about this because i did these type of things in past.

We can hide only our app in user mobile,we can't hide other apps in user mobile but we can block any app in user mobile. For this you can use any way either statically or dynamically(via server)

Now the question is how ? So here is the answer

  1. You need to run background and foreground both service. Now detect the app (package). It means you need to detect whether app is in foreground or in background.
  2. So if the app is in foreground then you need to close/block the app.

Now the another question is how we can close/block the app ?

Suppose you want to close/block Facebook app in user mobile then use condition like

   if (packagename.equals("com.facebook.katana"){
            Intent startMain = new Intent(Intent.ACTION_MAIN);
            startMain.addCategory(Intent.CATEGORY_HOME);
            startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(startMain);

    }

You need to use above code in service. Service will detect continuously whether Facebook app is in foreground or not. You can use timer or thread for this.

As soon as the service gets the Facebook Open then service will fire intent to Home Screen.

Above is the best possible way to close/ block the apps.

Thanks!

Jacquetta answered 16/11, 2018 at 12:50 Comment(0)
B
1

Do you plan to use it on your own devices? If so, you can create an app that will be started when you boot the device that will control running tasks. And when you detect the app you wish to kill, the service will kill it. You can create remotely configuration about which apps you blacklist using Firebase RemoteConfig functionality. https://firebase.google.com/docs/remote-config/

Belita answered 16/11, 2018 at 16:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.