5

I want the user to be able to be hide and display the Application Launcher Icon. I found a solution at https://www.nexsoftsys.com/articles/how-to-hide-application-launcher-lcon-in-android.html I also found this same solution at Hide application icon

However, in the latter link, it says that this code which appears in both of the above

PackageManager pm = getApplicationContext().getPackageManager(); 
pm.setComponentEnabledSetting(getComponentName(), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);

"will make the app NOT upgradeable from google play as the OS will not find the package after this component disabling and will not able to re-install it, unless the app is not manullay uninstalled (which is not a user friendly behaviour)"

I have tried to discover if this is true or not, but withe no luck. Can anybody answer this please ? Thanks very much in advance

Ichigo Kurosaki
  • 3,555
  • 8
  • 35
  • 51
user396707
  • 397
  • 1
  • 3
  • 14
  • 1
    Do you want the user to hide the icon from the home screen? or from the home screen, the application drawer, and anywhere else it may be found? If it's the latter and not the former, how do you expect the user to be able to access/launch your application once it's hidden? Some secret galleries/browsers use a calculator icon to hide their application, then the user has to go into the calculator, and then type a secret sequence of digits and commands to launch the underlying application. You may want to consider doing something like that instead for your app. – Stephan Branczyk Sep 16 '17 at 16:50
  • Thanks for the reply. If you see the second link above, I will enable the user to launch the app via the dialler. I would like the app to be hidden from all the above. – user396707 Sep 19 '17 at 13:54

3 Answers3

0

You can hide app icon using below code:

PackageManager p = getPackageManager();
ComponentName componentName = new ComponentName(this, com.apps.MainActivity.class); 
p.setComponentEnabledSetting(componentName,PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);

Show app icon using below code:

PackageManager p = getPackageManager();
ComponentName componentName = new ComponentName(this, com.apps.MainActivity.class);
p.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
Pratik
  • 97
  • 1
  • 11
0

You're asking us to prove a negative.

Unless that negative is explicitly articulated in the android documentation, or unless it's explicitly forbidden in the terms of services of Google Play for publishers/developers (which it does not seem to be, but I'm not a lawyer), it's actually very difficult to prove that a specific Android feature does not exist.

The only solution, that will work on all Android phones, that I know of, is to create your own custom launcher. With a custom launcher that the user installs and makes his primary launcher, you can hide any app you want from it, even itself.

Aside from that one solution, other partial solutions would be:

  1. On Samsung and Sony phones only, you could use the Samsung Knox API and the Sony proprietary APIs. If your application is commercial in nature, expect to pay money for this.

  2. On Samsung phones, it's also possible to give the user instructions for manually hiding the app icon himself.

  3. If your app is actually telephony based, which it sounds like it is, you might consider moving its functionality to the cloud with a service like Twilio or Voxeo. This way, the user would only need to add a phone number to his favorites/speed dial, without needing to install anything, and you could update your cloud-based application as frequently as you wanted without needing to update the phone. And perhaps, you could even enhance the functionality of your cloud-based application with the functionality of carrier specific APIs.

Stephan Branczyk
  • 9,144
  • 1
  • 29
  • 49
0

Since we can't know how Google Play (which is proprietary) upgrades a particular application, we cannot give any logical reasoning for this. It depends on how Google Play upgrades applications/ adds new patches. The only way to confirm this is to ask someone who has done it before. This question asks the same and one developer confirmed that it works. The answer was accepted.

My guess on this is: Currently, you must be disabling the launcher component for hiding the application. This doesn't mean that other components are disabled. Other components are still active. This is why active components should be still upgradable. To play safe, your future upgrades should be done in active components. You can alternatively use an alias launcher component for your application. Something like this.

Sachin Aggarwal
  • 1,025
  • 7
  • 16