Hide and show application icon

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

However, the second link 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 application not updatable from the Google game, since the OS will not find the package after disabling this component and will not be able to reinstall it if the application has not been removed by manullay (which is not a convenient way for the user)"

I tried to find out if this is true or not, but no luck. Can someone please answer this? Thank you very much in advance

+5
source share
3 answers

You ask us to prove a negative result.

If this negativity is explicitly stated in the Android documentation, or if it is explicitly prohibited in relation to the Google Play services for publishers / developers (which seems to be wrong, but I'm not a lawyer), it is actually very difficult to prove that a specific Android function does not exist.

The only solution that will work on all the Android phones that I know of is to create your own launcher . Using custom launcher, which the user installs and launches his main launcher, you can hide any application that you want from him, even to himself.

Besides this solution, other partial solutions are:

  • Only on Samsung and Sony phones can you use the Samsung Knox API and Sony's proprietary APIs. If your application is commercial in nature, expect to pay money for it.

  • On Samsung phones, you can also give user instructions to directly hide the application icon.

  • If your application is actually based on telephony, it looks like it is, you can move its functionality to the cloud using the Twilio or Voxeo service. Thus, the user will only need to add the phone number to his favorites / speed dial list, without requiring anything to be installed, and you can update the cloud application as often as you wanted, without having to update the phone. And perhaps you could even improve the functionality of your cloud application with the functionality of specific APIs.

0
source

You can hide the application icon using the code below:

 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 application icon using code below:

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

Since we cannot know how Google Play (which is the owner) is updating a specific application, we cannot give any logical arguments for this. It depends on how Google Play updates applications and adds new fixes. The only way to confirm this is to ask someone who has done this before. This question asks the same question, and one developer confirmed that it works. The answer was accepted.

My guess: at the moment, you should disable the startup component to hide the application. This does not mean that other components are disabled. The remaining components are still active. This is why active components must be available for upgrade. To play in a safe place, your future updates must be done in the active components. Alternatively, you can use the alias launcher component for your application. Something like this .

0
source

Source: https://habr.com/ru/post/1270346/


All Articles