top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to find if a user has uninstalled the Android application?

+3 votes
688 views
How to find if a user has uninstalled the Android application?
posted Feb 12, 2016 by Divya Shree

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

So how do you find if a particular user has UN-installed your application, a quick answer is GCM.

Lets look at what happens when you send a push to a device where your application has been UN-installed.. (picked up from GCM docs)

  • The end user un-installs the application.
  • Your server sends a message to GCM server.
  • The GCM server sends the message to the device.
  • The GCM client receives the message and queries Package Manager about whether there are broadcast receivers configured to receive it, which returns false.
  • The GCM client informs the GCM server that the application was UN-installed.
  • The GCM server marks the registration ID for deletion.
  • The 3rd-party server sends a message to GCM.
  • The GCM returns a NotRegistered error message to your server.
  • Your server should delete the registration ID.

So from the above steps, it’s easy to understand that if your server gets “Not Registered” error message, then the app has been UN-installed on the user’s device. So all you need to do is, send a silent push to your application, to check if it exists on user’s device.
But GCM server doesn’t return the error message even the app has been UN-installed, at least for the first few days of UN-installation.My guess is that GCM server takes some time to update the information of app UN-installation.

A more accurate approach will be to receive an ack from the application for the push message, So, if you receive an ack then the app still exists, if you don’t then the app doesn’t exist on the user’s device. But, there is a catch here, what if the app exists on the user’s device but the message is not delivered because the user isn’t connected with INTERNET. How long will you wait to receive the ack, here is where your conscience comes to the rescue, you have to decide the time you will wait for the ack and decide if the app exists on user’s device. If your app is dependent on INTERNET for the app usage and you don’t receive an ack with in 3-4 days, it’s safe to assume the user is useless to you whether he has the app or not, you can safely put him under UN-install category.

Identifying the uninstallation details can help you find some insights about the app if you can map user’s information with device information.

answer Feb 12, 2016 by Ramesh Gowda
+1 vote

you cant check that your application is going to uninstall.
When the user uninstalls the app, at first the process is killed, then your apk file and data directory are deleted, along with the records in Package Manager that tell other apps which intent filters you've registered for..
So there's no way for your application to know that it is being uninstalled (without modifying the kernel). All files created in the data/data/your.app.package is deleted automatically upon uninstall.

Another approach could be to have another application that checks whether this application is installed or not. If not, it can do the clean-up work and it also not reliable.

answer Feb 12, 2016 by Shivam Kumar Pandey
Similar Questions
+1 vote

I'm building an application that can only be built from the Android source and can build it just fine from the command line. I'd like to be able to build from Eclipse for speed. I've tried these instructions:

http://source.android.com/source/using-eclipse.html

But the instructions don't work anymore as the newer versions of eclipse seem to act quite differently that what is described here (I've tried 3.7 and 4.2). Both of those versions of Eclipse do not have the option number 5 in:

*   If Eclipse asks you for a workspace location, choose the default. 
*   If you have a "Welcome" screen, close it to reveal the Java perspective. 
*   File > New > Java Project 
*   Pick a project name, "android" or anything you like. 
*   Select "Create project from existing source", enter the path to your Android root directory, and click Finish. 
*   Wait while it sets up the project. (You'll see a subtle progress meter in the lower right corner.) 

So instead I tried to "Import" the source code but as some of the projects to import have duplicate names (which don't seem to be changeable). Even removing some of the duplicate projects leaves the overall state with tonnes of build errors.

So...are there better instructions out there for building with the most recent versions of eclipse?

+1 vote

My ultimate goal is to create a new lock screen for android so I thought that the best way to do that is to modify the source files that already implement the lock screens in android and particularly in android 4.2 or 4.3. I followed the instructions in http://source.android.com/source/building.html and i successfully downloaded and built android 4.3 in my computer. The next step is the modification of some java files. I want to do this with eclipse. I have eclipse 4.3.1 and I am trying to follow the instructions in http://source.android.com/source/using-eclipse.html . The problem is that the instructions are for older version of eclipse and with the new version i cant follow the 5th step as shown below :

  • If Eclipse asks you for a workspace location, choose the default.
  • If you have a "Welcome" screen, close it to reveal the Java perspective.
  • File > New > Java Project
  • Pick a project name, "android" or anything you like.
  • SELECT "CREATE PROJECT FROM EXISTING SOURCE", ENTER THE PATH TO YOUR ANDROID ROOT DIRECTORY, AND CLICK FINISH.
  • Wait while it sets up the project. (You'll see a subtle progress meter in the lower right corner.)

How can I do this correctly in eclipse 4.3.1 ; If i follow the wright steps will I be able to import all android 4.3 in eclipse without showing any errors? Please help me.

+4 votes

What is Unable to resolve target 'android-15' until the SDK is loaded? IN eclipse I am getting the error while am try to run my app. Please help me how to solve this issue.

+3 votes

With the major milestone release of Android Studio, I am worried about the suggested IDE for platform development. As we can see on the web [ http://source.android.com/source/using-eclipse.html ], there is a sort of tutorial to set up an Eclipse Environment for AOSP development: while it does not directly involve the ADT plugin, at the same time its presence in the environment it's useful in some situations.

Is there any plan for a substitution of Eclipse as "endorsed" IDE for AOSP?

...