Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to programmatically uninstall a package in Android

Tags:

android

Can a package uninstall itself? Can a package uninstall another package if they share the same userId and signature?

like image 574
Will Avatar asked May 21 '09 02:05

Will


People also ask

How to uninstall package in Android programmatically?

Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.

How do I stop programmatically uninstalling Android apps?

Use AppLock In this manner, users will need to use the authentication method you previously set to open the Settings app. If you want to block users from uninstalling specific apps, scroll down to General. Then, simply lock the respective app(s). Once the app locked, users won't be able to launch it or uninstall it.

How do I uninstall ADB packages?

To remove the app go into your Android device's shell by running adb shell . Once there, run pm uninstall -k --user 0 package.name (replacing package.name with the name of the package you searched for earlier). You can also run adb shell pm uninstall -k --user 0 package.name if you choose.

How do I uninstall package installer?

Since Package Installer is built into the Android OS, it is not possible for a normal user to remove the package installer from the device. One also cannot uninstall the Package Installer from Android.


1 Answers

Uri packageURI = Uri.parse("package:"+"your.packagename.here"); Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI); startActivity(uninstallIntent); 
like image 108
Robby Lebotha Avatar answered Oct 28 '22 23:10

Robby Lebotha