3

I recently reported bug for two apps that I use. The support guys replied that I need to delete cache and unblock notifications, set battery optimization and putting that app to sleep to turned off. These are understandable steps to fix an issue.

What puzzled me that both the app support guys additionally suggested that I should uninstall the app and reinstall. Which I will not do because that will mean I have to manually download all the downloaded content again (more then 50+). Seems like a nuclear option.

I am not an Android developer, a .Net full stack developer. Their response made me curious and now I want to know what happens when an app is uninstalled. What made the support guys of these renowned apps to tell me to go nuclear and uninstall the app and then reinstall again?

Additionally which these steps can be performed without uninstalling the app to verify if issue is not with code of the app but it is some other factor?

This question is not regarding those two apps that has bugs but rather to get better understanding of the life-cycle of an Android app.

As of my understanding, in my .Net app most bugs usually are caused by either code or cache issue (tbh cache issue is also due to code not properly handling caches).

As my understanding in Android is limited, I tried to research what are the events and tasks that Android OS performs, that might cause an app's bug to get fixed (Not an effort to fix issue for those apps, rather to understand what Android OS does) however I didn't find much resource on the internet.

  • 1
    By deleting the app data all problems that may be caused by data migration issues are gone. Because of the high update frequency of apps migrating the app-specific user data is a big topic and a potential source of problems. Also it is an "easy solution" - from the app developers perspective of course. – Robert Apr 8 at 17:27
3

Application updates do not recognise OTA Updates..

I have had several problems lately due to the fact that still use Android 5.0 and updating an application built for Android 8.0 or Android 7.0 will not work on my device..

The application will install the update, however the Data is still configured for Android 5.0 so the application can not read its own data...

Uninstalling the application will erase the Data and allow a fresh installation to initialize the data for a newer configuration.

From my point of view as a developer, i believe that Uninstalling & Reinstalling can be an over kill of a method.

As a developer, i see two options...

Delete All Data to the Application to reinitialize the configuration when you reopen the app.

  • Open Settings

  • Open Apps

  • Find and Open the Apps

  • Select Clear Data & Clear Cache

...

It may also be a file on the primary SD Card, this is the last stuff to be deleted ( .Android folder )

  • Open your primary SD Card

  • Open the hidden folder ( .android )

  • Open OBB folder

  • Locate large data that is linked to the application package name...

  • Move the OBB Files to a backup folder

  • Open the .android folder again

  • Open the other folders and locate the Apps data

    Leave the Apps data if it is too large to re download, sometimes you must re-download the data because the app has had the data reset it won't think the data exists until you complete a new data download.

Uninstalling has already been explained, i just wanted to add my suggestions on wiping data for the app, rather than uninstalling.

  • This makes a lot sense now. That those apps might be having the data configured for older version of Android. I reported the first bug after a week of my phone getting upgraded from Android 8 to Android 9. And the second one might be same too even though I found the issue one month later. I got into that bug reproduction scenario only when I actually started using the feature. The issue might have been there since my phone's upgrade. – atiqorin Apr 9 at 13:20
2

uninstalling an app will remove entry from /data/system/packages.xml, and delete package from
/data/app/ (apk file)
/data/data/ (user data and cache)
/data/dalvik-cache/arm/ (translated java bytecode to executable dalvik bytecode)

clear cache can performed from android settings
custom recovery twrp has option for wipe dalvik-cache

  • 1
    In addition to /data/app/ and /data/data/, directories from /sdcard/Android/data, /data/misc/profiles/ and /data/user_de/0/ are also deleted. Other files which may be affected include /data/system/packages.list, /data/system/packages.xml, /data/system/users/0/runtime-permissions.xml, /data/system/appops.xml, /data/system/users/0/package-restrictions.xml, /data/system/notification_policy.xml and /data/system_ce/0/shortcut_service/shortcuts.xml. /data/dalvik-cache/ is only used for system apps, not for user apps. User apps' cache is located in /data/app/<PKG>/oat/. – Irfan Latif Apr 8 at 21:18
  • thx i was wondering where dalvik-cache was gone after kitkat. seems for system apps are just symlinks, they have moved too – alecxs Apr 9 at 7:09
  • I think links are for framework (usually .jar) files. Apps (.apk files) don't contain executable (.odex or .oat) files, so those are created in /data/dalvik-cache/ for system apps. – Irfan Latif Apr 9 at 7:58
2

If the app stores most of its data online (in the cloud) through an account, then uninstall/reinstall isn't actually that nuclear. All you'd have to do upon reinstallation is sign in and the app should pull all your content back from the cloud. That's the ideal case at least, but of course you never know.

To answer the original question though, uninstall/reinstall is supposed to give you a clean slate and rid you of any accumulated crud and other subtle anomalities in user data. May or may not make sense in theory but practice has shown it helps get rid of problems surprisingly often. This is not restricted to just Android, a similar approach often helps on many other platforms, mobile, desktop, and elsewhere.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.