How can you reproduce the procedure that occurs when updating the Android Market application?

I have an application that reads and writes files during onCreate . The problem is that when the application is installed through the Market and launched for the first time, the files that it needs to receive do not have access to them. I get FileNotFound exceptions, although there is a file. If I return from the application and open it again, the files will be read.

This is not the same behavior when clicking apk from eclipse or adb. Actually, I was able to reproduce the problem using eclipse and thought that I fixed it by doing adb uninstalls and installing eclipse, but the problem remains for users who are pulling the update from the market.

+4
source share
3 answers

adb -d shell pm uninstall -k package.name allows you to remove a package without deleting data files or cache.

0
source

If you are increasing your CodeVersion, then create your apk (signed with the same certificate as the previous application on the market) by running adb -d install -r package.name will install the application without deleting the data. This is basically an update. I believe that using the -l option ensures that the CodeVersion number will also matter more than what is currently on the phone.

+2
source

I would try:

  • Increase android:versionCode in your AndroidManifest.xml
  • Create apk
  • adb install name.apk
0
source

Source: https://habr.com/ru/post/1315526/


All Articles