Installing an application without an icon or action

I had a discussion with a friend, and he told me that some applications can be installed on android without any action or icon displayed on the menu. Since I also study android, I was surprised because I had never heard of this.

The application name is displayed in the Application Management section and is easy to remove.

So now I ask as a programmer. How is it possible (if possible) to install such an application? (no activity or launch).

+6
source share
3 answers

Just remove all of the following intent filters from your manifest:

<intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> 

Keep in mind that, starting with Android 3.1, your application will not receive any broadcasts or will be indicated in other places where the intent filter will make it available (for example, in the shared menu) if the user did not manually open the applicationโ€™s user interface (main activity) at least once from launch.

+9
source

There is another way that works even on Android3.1 +. You cannot disable the icon itself, but you can disable one component of the application. Thus, disabling application launch activity will cause its icon to be removed from the launch.

The code for this is simple:

 ComponentName componentToDisable = new ComponentName("com.helloandroid.apptodisable", "com.helloandroid.apptodisable.LauncherActivity"); getPackageManager().setComponentEnabledSetting( componentToDisable, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); 

You can find out about this solution several times:

1 - a disabled component will not start in any way

2 other uninfected actions will be launched from other applications

3 - the application can disable only its component. There is a permission of "android.permission.CHANGE_COMPONENT_ENABLED_STATE", but it does not work, third-party messages cannot have this permission.

4 - the icon will disappear only after restarting the launcher, so the next time you restart the phone, you probably need to restart the restart of the launcher.

Therefore, the application should be launched at least on time.

Link:

Removing an application icon from the launcher

+5
source

Yes, such an application is possible. You need to create an application that has no Launcher activity in the manifest file.

For example: - You can register a broadcast for a received download. So, when the device boots up, your application will be called, although it does not have any user interface. You can check out this one.

NOTE - this type of application will only work below 3.1.

+2
source

All Articles