How to protect uninstalled applications on android when user wishes to remove that app? [closed]

StackOverflow https://stackoverflow.com/questions/21795126

Domanda

I have looked at this link

I have some applications on my phone. When kids play some games they are deleting few applications on my phone without intending to. Is lock security is possible for those applications? Also my doubt is about what are the possibilities available to remove an un-installed application with full protection? Do I need to create any lock-security for this requirement when I am removing an app? If so then when I remove an app it can be protected and store it in some folder so could be used for future reference.

For reference!

When I googled, just I understand a bit about there is no way for an application to know that its being un-installed. Is it true? And, few documentation says that cannot be done on third party applications because of some security reasons. What is the real scenario of security issue that arises here?

And my doubt is, why this requirement cannot be done without coding when there is a way to do with programmatically on Android? When we write a code based on this requirement then at that time no security issue will take place? Then why not without coding?

È stato utile?

Soluzione

You can try and do this programmatically, uninstall in the options menu or so, but the user still has to confirm the installation and uninstallation of everyting. I have not personally tested the uninstall part, But it looks like it can work for you.

By doind it programmatically, remove all the files and folders yourself and run the intent for the user to do the rest

Install APK using Intent:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(apkUri, "application/vnd.android.package-archive");
startActivity(intent);

Uninstall APK using Intent:

Intent intent = new Intent(Intent.ACTION_DELETE, Uri.fromParts("package",
getPackageManager().getPackageArchiveInfo(apkUri.getPath(), 0).packageName,null));
startActivity(intent);

I hope you work something out.

Source

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top