Android Uninstall Package - android

I am developing the android application in which
The application has a stored password (set by user when application is first installed)
My application is the device administrator
The issue is when user clicks on uninstall of this application , i want user to input the password of the application
The process i will follow there after is :
Show password Page
Remove Device admin Rights by certain code
Allow un-installing
Please help me with the detection of the uninstall click of my application to shoot the password page.. !!
Thanks in advance !

Do you mean to intercept the uninstall of your app, and query for a password? That is not possible. Similar questions has been asked before, for example here.
Edit: It does seem as some related things can be done by making your application a Device Admin Application:
"To uninstall an existing device admin application, users need to first
unregister the application as an administrator."
However I am not familiar with the restrictions that comes with this, and if it allows your exact use case.

Related

How to uninstall app which is set by password?

I developed one parent and child communication Android application in which I wanted to restrict the child from uninstalling application. I have one solution that uses DevicePolicyManager. But still the application can be uninstalled without asking for password. If I remove the Device Administrator permission from the settings, then application is uninstalled from device?
Can anyone provide the valid solution for this cause?
You cannot prevent a user from uninstalling an app, from within the app code itself.
There is suggestions here How to prevent an application from being uninstalled?, but they are not foolproof.
The way around this is to use an android device with lollipop and upwards, so you can create a user account.
On the admin account, install an app that requires a password to uninstall apps. They are on the market (and free) I've used them. Or write one yourself.
Then on the child's account allow them whatever privileges you want them to have. They will be unable to touch the apps and uninstall them, unless on the admin account and with the password required for that app to uninstall other apps.
I have tried and tested this and it works.

Is there a way to prevent a user to uninstall an app?

I'm making an android anti-thief app. I want to prevent a thief to uninstall the anti-thief app.
The app is a device administrator. So I used DeviceAdminReceiver.onDisabled
to start a “always on top” password prompt Activity (the password is setup by the user during the app configuration). This works fine.
But, Google Play rejected the app. Email extract:
Read through the Device and Network Abuse policy and make the
appropriate changes to your app. You’ll need to remove any
functionality that prevents a user from removing or uninstalling the
app from their device.
My Question:
What other ways can I use to prevent unauthorized user to:
uninstall my device administrator app ?
disable the device administrator permission ?
Thanks
EDIT: reformulate the question to clarify that the question is not about google play policy, but about alternative implementation.

Make android app non erasable

Is is possible to make an android app non deletable.. What i mean is, I want to install a app, but I cant remove/ uninstall it. If I want to uninstall it then it should prompt me for password which I would have set during installation of the app.
When I read the docs they tell it can be done using Device Admin, but it doesnt provide security, interms of it doesn't ask the user for the password and deletes if its correct..
Is it possible to make an app such that even if there is a factory reset the app will still be there on the phone ?
Is is possible to make an android app non deletable
No, unless you want to create your own ROM and preload it with your app, just like some manufactures preload their devices with their own software and other bloatware.
No it is possible to restrict any user to delete the app from android device.
As google already maintaining this scenario by using the concept known as Device Management System.
Google Eyeing on apps which are published by the developer / installed or deleted by the user.
Although you can make your own app which will notify your admin that user is trying to delete the app or deleted the app, using Service Intent concept.

uninstall android application from inside the application?

Hi friends my question is little complicated.I am currently making an password related project ie, the app only open when user enter his/her password.While developing the application i figured that my application can only open by entering the password ,but what if any stranger/friends take my phone and uninstall my application .Then all the data that store in my app will be destroyed.so i am thinking that ask a password before uninstalling the app or disable the uninstall button form the application uninstalling process ie, the uninstall button should only enable when i do some thing from inside my app.now is that possible if so please replay
Not possible I'm afraid. Lock the phone with a password instead.
There some apps, which allow starting app only after you enter password.
They all utilize system logs, i.e. by reading that log you know when certain Activity starts.
And, you can "intercept" that. So, maybe that will help you.

Creating a Password when installing an android apps

I want to create an application that prompts the user to create a password before the application is installed and also before the application can be uninstalled the password must be entered.
I have ran out of ideas on how to go about the code.
Please can anyone give me a code and an insight on how to go about this_
I would appreciate a lot.
You can use shared preference/db to have default value and see if there is a default value you can prompt dialog
I want to create an application that prompts the user to create a
password before the application is installed
To be clear you said BEFORE the app is installed. This might be Possible. But "dirty". In the user journey your user downloads and installs the APK from the market or where ever. None of your app code has run yet so there's nothing to leverage.
A possible work around, which I have heard others use but not tried myself so no guarantees, is to write a login app that when installed prompts for password creation and on success downloads the actual app.
I would probably say - why? What it the motive behind doing this? Lots of apps work fine installing the whole app (Spotify comes to mind).
I don't think this is possible the android market takes downloads and installs or user installs some other way and the user uninstall via manage application in the settings, all of these things happen outside of the scope of an app
See Device Administrations API

Categories

Resources