4

I would like to know which users have uninstalled my application so that I can ask them for a feedback to improve the app. Hence, I would like to detect when the user has initiated the uninstallation process on my app.

One of the older solutions on StackOverflow had the following steps:

 List< ActivityManager.RunningTaskInfo > taskInfo = am.getRunningTasks(MAX_PRIORITY); 
         String activityName = taskInfo.get(0).topActivity.getClassName();
         if (activityName.equals("com.android.packageinstaller.UninstallerActivity")) {
 // do whatever is needed

Since Lollipop, getRunningTasks has been deprecated. So how can com.android.packageinstaller.UninstallerActivity activity be detected without getRunningTask?

Alternatively is there any other method to detect uninstallation process has been started on my app? Using getAppTask probably?

Community
  • 1
  • 1
suku
  • 10,507
  • 16
  • 75
  • 120
  • 1
    You'd probably get more/better feedback from users that want to keep the app than users who want to uninstall it. – DeeV Jun 15 '16 at 14:59

4 Answers4

2

Apparently you wont be able to do this, you will have to rely on something called silent notification.

What we did was we sent notification every 3 days or whatever frequency you want. On the client side as soon as a notification is received we hit a network call which mark NotificationReceived for the client. Now since notification are not full proof we assumed a threshold of 2/3 missed notification as uninstall event. And for the client we have this counter above decided threshold we contacted them for feedback.

Also no one will be willing to fill your form at the time of uninstallation as user has already decided to uninstall your application.

saurabh dhillon
  • 798
  • 7
  • 17
  • 1
    Can you please explain "we sent notification every 3 days"? What is "we" there? And in "On the client side as soon as a notification is received we hit a network call": what is "we" again? – dugsmith Dec 09 '19 at 17:36
  • 1
    @dugsmith man i suggest that you ask your developer to read this answer, i think he will get the context better here. I can't get into explaining the use of word "we". Refer this link for further reference "https://www.merriam-webster.com/dictionary/we" – saurabh dhillon Dec 10 '19 at 07:38
  • "The great enemy of communication is the illusion of it." William Whyte https://quoteinvestigator.com/2014/08/31/illusion/. – dugsmith Dec 11 '19 at 15:40
  • @dugsmith "we sent notification every 3 days"? -> Here we refers to a cron job running every 24 hr to send notification to all your users. "On the client side as soon as a notification is received we hit a network call" -> Here we refers to the user app(andorid/ios) which trigger a network call to register the notification as received, – saurabh dhillon Apr 03 '20 at 17:10
1

Read these 2 questions and answers:

  1. native solution

  2. GCM solution

As I know you have to mix the two. Read the limitations of first solution. You have to confirm uninstallation event of the first solution with the second solution for a complete implementation.

Sina
  • 2,683
  • 1
  • 13
  • 25
  • 1
    There are many comments under that first solution that question whether it works in current Android versions. I was hoping for an answer that was likely to work in the latest versions of Android. – dugsmith Dec 09 '19 at 17:32
1

Just set a variable named appLastPresent for every user in the server-side and update that variable every day by calling an API using WorkManager's PeriodicWorkRequest. Also set installedDate variable when the user installs the app.

Now set up a chron job on the server side to check if the difference between installedDate and appLastPresent is greater than 7 days. Then send the user an email or message enquiring for issues or feedback, if it is greater.

NB: User can be offline for 7 days. Therefore only send email enquiring like why you are not using the app, if uninstalled please let us know why

a0x2
  • 1,995
  • 1
  • 18
  • 26
  • 1
    @dugsmith this is the canonical answer you are looking for – a0x2 Dec 10 '19 at 09:12
  • yes, this is much more helpful than others. I'm sorry I let the bounty expire and it was auto-awarded. But I appreciate your help. – dugsmith Dec 11 '19 at 16:03
  • @a2en WorkManager's are not full proof, reason being lets say user force stop the app the work manager is no surety to run even though android documentation says it is but it do not work as expected. So you might be getting false positives with this approach. Try the approach i suggested above for a change. – saurabh dhillon Apr 03 '20 at 17:13
  • @saurabhdhillon Your push doesn’t work too, if the app is force stopped [https://stackoverflow.com/a/20838611/6225053. And workmanager is guaranteed to run even after force stopping according to docs, `The task is still guaranteed to run, even if your app is force-quit or the device is rebooted.` [https://developer.android.com/topic/libraries/architecture/workmanager – a0x2 Apr 04 '20 at 04:49
1

Hopefully, this solution will work for you. It helps you understand the reasons for your app uninstalls, reduce the uninstall rate using a powerful predictive engine and also get app Re-installs through a unique actionable channel (Android version 4.0 and above).

Gk Mohammad Emon
  • 6,084
  • 3
  • 42
  • 42